ibkr-agent-gateway 0.5.2

Unofficial local-first CLI and MCP gateway for Interactive Brokers workflows.
Documentation
//! Paper order MCP tools.

use super::super::schemas::{ToolSchema, object_schema, safe_output_schema};
use crate::internal::auth::{ORDERS_PAPER_CANCEL, ORDERS_PAPER_MODIFY, ORDERS_PAPER_SUBMIT};

/// Paper submit tool.
pub const PAPER_ORDER_SUBMIT_TOOL: &str = "ibkr_paper_order_submit";
/// Paper cancel tool.
pub const PAPER_ORDER_CANCEL_TOOL: &str = "ibkr_paper_order_cancel";
/// Paper modify tool.
pub const PAPER_ORDER_MODIFY_TOOL: &str = "ibkr_paper_order_modify";

/// Schema for paper submit.
#[must_use]
pub fn paper_order_submit_schema() -> ToolSchema {
    ToolSchema {
        name: PAPER_ORDER_SUBMIT_TOOL.to_string(),
        scope: ORDERS_PAPER_SUBMIT.to_string(),
        input_schema: object_schema(&["account_id", "approval_id", "idempotency_key"]),
        output_schema: safe_output_schema(),
    }
}

/// Schema for paper cancel.
#[must_use]
pub fn paper_order_cancel_schema() -> ToolSchema {
    ToolSchema {
        name: PAPER_ORDER_CANCEL_TOOL.to_string(),
        scope: ORDERS_PAPER_CANCEL.to_string(),
        input_schema: object_schema(&["account_id", "broker_order_id", "idempotency_key"]),
        output_schema: safe_output_schema(),
    }
}

/// Schema for paper modify.
#[must_use]
pub fn paper_order_modify_schema() -> ToolSchema {
    ToolSchema {
        name: PAPER_ORDER_MODIFY_TOOL.to_string(),
        scope: ORDERS_PAPER_MODIFY.to_string(),
        input_schema: object_schema(&["account_id", "broker_order_id", "idempotency_key"]),
        output_schema: safe_output_schema(),
    }
}