Skip to main content
Glama
nadavgb-atom

ib-async-mcp

by nadavgb-atom

get_head_timestamp

Retrieve the earliest available historical data timestamp for a specified financial instrument from Interactive Brokers. Use this tool to determine the starting point for historical market data queries.

Instructions

Get earliest available historical data timestamp.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contract_typeYes
symbolYes
exchangeNoSMART
currencyNoUSD
what_to_showNoTRADES

Implementation Reference

  • The _handle_tool function routes to the 'get_head_timestamp' block which sets up the contract, qualifies it, and calls reqHeadTimeStampAsync.
    if name == "get_head_timestamp":
        contract = create_contract(
            args["contract_type"],
            symbol=args["symbol"],
            exchange=args.get("exchange", "SMART"),
            currency=args.get("currency", "USD"),
        )
        await ib.qualifyContractsAsync(contract)
        ts = await ib.reqHeadTimeStampAsync(
            contract,
            whatToShow=args.get("what_to_show", "TRADES"),
            useRTH=True,
            formatDate=1,
        )
        return {"head_timestamp": ts.isoformat() if ts else None}
  • The tool 'get_head_timestamp' is registered in the list of available tools with its input schema.
    Tool(
        name="get_head_timestamp",
        description="Get earliest available historical data timestamp.",
        inputSchema={
            "type": "object",
            "properties": {
                "contract_type": {"type": "string"},
                "symbol": {"type": "string"},
                "exchange": {"type": "string", "default": "SMART"},
                "currency": {"type": "string", "default": "USD"},
                "what_to_show": {"type": "string", "default": "TRADES"},
            },
            "required": ["contract_type", "symbol"],
        },
    ),
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It fails to specify the timestamp format returned (ISO 8601, Unix epoch?), whether this performs a live exchange lookup or cached lookup, error conditions for invalid symbols, or rate limiting concerns.

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

Conciseness3/5

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

The single sentence is efficient and front-loaded, but underspecified for a tool with 5 undocumented parameters and complex financial data semantics. It is brief at the cost of necessary parameter and behavioral context.

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 5 parameters with no schema descriptions, no annotations, and no output schema, the description is critically incomplete. It omits return value structure, parameter semantics, and how the 'what_to_show' parameter affects the timestamp calculation.

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?

With 0% schema description coverage across 5 parameters, the description must compensate but mentions none of them (contract_type, symbol, exchange, currency, what_to_show). It only implicitly suggests parameters identify an instrument, without explaining valid values for contract_type (e.g., 'STK', 'OPT') or what_to_show options.

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?

The description clearly states the core action (get) and resource (earliest available historical data timestamp). However, it does not explicitly distinguish this metadata lookup from the sibling `get_historical_data` tool that retrieves actual price data, though 'timestamp' implies this returns boundary metadata rather than series data.

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?

No guidance provided on when to use this tool versus alternatives, or that it should typically be invoked before `get_historical_data` to determine valid date ranges. No prerequisites or conditions mentioned.

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