Skip to main content
Glama
nadavgb-atom

ib-async-mcp

by nadavgb-atom

place_order

Execute trades by submitting buy or sell orders with customizable parameters like order type, quantity, and pricing for financial instruments.

Instructions

Place a new order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contract_typeYes
symbolYes
exchangeNoSMART
currencyNoUSD
actionYesBUY or SELL
quantityYesOrder quantity
order_typeYesOrder type: market, limit, stop, stop_limit
limit_priceNoLimit price (for limit orders)
stop_priceNoStop price (for stop orders)

Implementation Reference

  • The handler for the 'place_order' tool, which constructs the appropriate order type (Market, Limit, etc.) and uses the ib_async library to place the order.
    if name == "place_order":
        contract = create_contract(
            args["contract_type"],
            symbol=args["symbol"],
            exchange=args.get("exchange", "SMART"),
            currency=args.get("currency", "USD"),
        )
        await ib.qualifyContractsAsync(contract)
        
        order_type = args["order_type"].lower()
        action = args["action"].upper()
        quantity = args["quantity"]
        
        if order_type == "market":
            order = MarketOrder(action, quantity)
        elif order_type == "limit":
            order = LimitOrder(action, quantity, args["limit_price"])
        elif order_type == "stop":
            order = StopOrder(action, quantity, args["stop_price"])
        elif order_type == "stop_limit":
            order = StopLimitOrder(action, quantity, args["limit_price"], args["stop_price"])
        else:
            raise ValueError(f"Unknown order type: {order_type}")
        
        trade = ib.placeOrder(contract, order)
        return {
            "order_id": trade.order.orderId,
            "status": trade.orderStatus.status,
            "filled": trade.orderStatus.filled,
            "remaining": trade.orderStatus.remaining,
        }
  • The schema registration for the 'place_order' tool, defining the required input fields and their types.
    Tool(
        name="place_order",
        description="Place a new order.",
        inputSchema={
            "type": "object",
            "properties": {
                "contract_type": {"type": "string"},
                "symbol": {"type": "string"},
                "exchange": {"type": "string", "default": "SMART"},
                "currency": {"type": "string", "default": "USD"},
                "action": {"type": "string", "description": "BUY or SELL"},
                "quantity": {"type": "number", "description": "Order quantity"},
                "order_type": {"type": "string", "description": "Order type: market, limit, stop, stop_limit"},
                "limit_price": {"type": "number", "description": "Limit price (for limit orders)"},
                "stop_price": {"type": "number", "description": "Stop price (for stop orders)"},
            },
            "required": ["contract_type", "symbol", "action", "quantity", "order_type"],
        },
    ),
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but discloses nothing about: monetary side effects, irreversibility, error handling, rate limits, or confirmation requirements. The term 'Place' implies mutation but lacks safety context essential for trading operations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

At three words, it is brief but constitutes under-specification rather than efficient conciseness. No information is front-loaded; the sentence adds zero value beyond the tool name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a high-stakes financial mutation tool with 9 parameters, no output schema, and no annotations, the description is dangerously incomplete. It omits return value structure, error scenarios, and whether this submits to live markets or paper trading.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 56% (below 80% threshold), leaving critical parameters like 'contract_type' and 'symbol' undocumented. The description adds no semantic guidance, valid value ranges, or cross-parameter dependencies (e.g., limit_price required when order_type='limit').

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Place a new order' is a tautology that restates the tool name. It fails to specify that this executes real financial transactions or distinguish it from the sibling tool 'what_if_order' (which likely simulates orders without execution).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance provided on when to use this versus 'what_if_order' (critical for financial safety), prerequisites (connection status, account permissions), or when to prefer 'cancel_order' for error correction. Missing essential guardrails for a destructive financial operation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nadavgb-atom/ib-async-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server