Skip to main content
Glama
nadavgb-atom

ib-async-mcp

by nadavgb-atom

qualify_contracts

Fill missing contract fields like conId by qualifying Interactive Brokers trading contracts using symbol and contract type.

Instructions

Qualify contracts to fill in missing fields like conId.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contract_typeYes
symbolYes
exchangeNoSMART
currencyNoUSD

Implementation Reference

  • The handler for the qualify_contracts tool, which creates a contract object and then uses ib_async's qualifyContractsAsync method to qualify it.
    if name == "qualify_contracts":
        contract = create_contract(
            args["contract_type"],
            symbol=args["symbol"],
            exchange=args.get("exchange", "SMART"),
            currency=args.get("currency", "USD"),
        )
        qualified = await ib.qualifyContractsAsync(contract)
        return [serialize_object(c) for c in qualified]
  • The registration of the qualify_contracts tool, including its name, description, and input schema.
    Tool(
        name="qualify_contracts",
        description="Qualify contracts to fill in missing fields like conId.",
        inputSchema={
            "type": "object",
            "properties": {
                "contract_type": {"type": "string"},
                "symbol": {"type": "string"},
                "exchange": {"type": "string", "default": "SMART"},
                "currency": {"type": "string", "default": "USD"},
            },
            "required": ["contract_type", "symbol"],
        },
    ),
Behavior3/5

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

With no annotations, the description carries the full burden. It successfully discloses that the operation enriches contracts by filling the conId field, but omits critical operational details like whether this requires an active broker connection, if it validates against the exchange, or what happens if multiple contracts match the input criteria.

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

Conciseness4/5

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

Single sentence with no wasted words and front-loaded verb. However, extreme brevity is inappropriate given the complete absence of schema documentation and the technical complexity of financial contract qualification.

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?

Given four undocumented parameters, no annotations, no output schema, and domain-specific complexity (Interactive Brokers API), a single sentence is inadequate. Missing crucial context like error conditions, whether the operation is idempotent, and what the return payload contains (presumably the qualified contract with conId).

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 has 0% description coverage, but the description fails to compensate by documenting the four parameters (contract_type, symbol, exchange, currency). It does not explain valid values for contract_type (e.g., 'STK', 'OPT'), required symbol formats, or the significance of the 'SMART' default exchange.

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

Purpose4/5

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

Uses specific verb 'qualify' and resource 'contracts', and explains the concrete effect (filling in missing fields like conId). However, 'qualify' assumes domain knowledge of IB API terminology and doesn't explicitly differentiate from sibling 'create_contract' or 'get_contract_details'.

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

Usage Guidelines2/5

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

Provides no guidance on when to use this tool versus alternatives like 'create_contract' (local object creation) or 'get_contract_details'. Does not mention typical prerequisite scenarios like having partial contract information that needs resolution.

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