Skip to main content
Glama
nadavgb-atom

ib-async-mcp

by nadavgb-atom

get_market_data

Retrieve real-time market data snapshots for financial contracts to monitor current prices and market conditions.

Instructions

Get real-time market data snapshot for a contract.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contract_typeYes
symbolYes
exchangeNoSMART
currencyNoUSD

Implementation Reference

  • Handler for 'get_market_data' tool which requests market data for a contract using ib_async and returns a dictionary of ticker values.
    if name == "get_market_data":
        contract = create_contract(
            args["contract_type"],
            symbol=args["symbol"],
            exchange=args.get("exchange", "SMART"),
            currency=args.get("currency", "USD"),
        )
        await ib.qualifyContractsAsync(contract)
        tickers = await ib.reqTickersAsync(contract)
        if tickers:
            t = tickers[0]
            return {
                "symbol": contract.symbol,
                "bid": t.bid,
                "ask": t.ask,
                "last": t.last,
                "volume": t.volume,
                "open": t.open,
                "high": t.high,
                "low": t.low,
                "close": t.close,
            }
        return {"error": "No data available"}
  • Definition and input schema for the 'get_market_data' tool.
    Tool(
        name="get_market_data",
        description="Get real-time market data snapshot for a contract.",
        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"],
        },
    ),
Behavior2/5

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

No annotations provided, so description carries full responsibility. 'Real-time' and 'snapshot' imply synchronous current data retrieval, but description omits critical trading API details: rate limits, whether this consumes market data subscriptions, connection requirements, caching behavior, or handling of market closed scenarios.

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, 9 words. Information-dense without redundancy. However, extreme brevity becomes a liability given the complexity of the financial domain and lack of schema documentation.

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?

Inadequate for a 4-parameter trading tool with 0% schema coverage, no annotations, and no output schema. Description fails to indicate what market data fields are returned (price, volume, greeks, etc.) or how to interpret results, which is critical given the sibling tool density (30+ tools) and potential confusion with get_contract_details.

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 description coverage is 0% (4 undocumented parameters). Description mentions 'contract' generally, implying parameters identify a contract, but fails to explain valid contract_type values (STK, OPT, etc.), symbol formats, or the significance of exchange/currency defaults.

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?

States specific action (Get) and resource (real-time market data snapshot) with scope (for a contract). Uses 'real-time' and 'snapshot' which partially distinguish from get_historical_data, though it fails to differentiate from get_contract_details which also retrieves contract information.

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 versus siblings like get_historical_data or get_contract_details. No mention of prerequisites like active connection (is_connected sibling exists) or market hours.

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