Skip to main content
Glama
nadavgb-atom

ib-async-mcp

by nadavgb-atom

run_scanner

Execute market scans to identify stocks matching specific criteria like top gainers or most active, using Interactive Brokers data for trading analysis.

Instructions

Run a market scanner.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scan_codeYesScanner code (e.g., TOP_PERC_GAIN, MOST_ACTIVE)
instrumentNoInstrument typeSTK
location_codeNoLocation codeSTK.US.MAJOR
num_rowsNoNumber of results

Implementation Reference

  • The handler implementation for the 'run_scanner' tool, which constructs a ScannerSubscription and executes it using ib.reqScannerDataAsync.
    if name == "run_scanner":
        from ib_async import ScannerSubscription
        subscription = ScannerSubscription(
            scanCode=args["scan_code"],
            instrument=args.get("instrument", "STK"),
            locationCode=args.get("location_code", "STK.US.MAJOR"),
            numberOfRows=args.get("num_rows", 10),
        )
        results = await ib.reqScannerDataAsync(subscription)
        return [{
            "rank": r.rank,
            "symbol": r.contractDetails.contract.symbol if r.contractDetails.contract else None,
            "sec_type": r.contractDetails.contract.secType if r.contractDetails.contract else None,
        } for r in results]
  • The Tool registration and input schema definition for 'run_scanner'.
    Tool(
        name="run_scanner",
        description="Run a market scanner.",
        inputSchema={
            "type": "object",
            "properties": {
                "scan_code": {"type": "string", "description": "Scanner code (e.g., TOP_PERC_GAIN, MOST_ACTIVE)"},
                "instrument": {"type": "string", "default": "STK", "description": "Instrument type"},
                "location_code": {"type": "string", "default": "STK.US.MAJOR", "description": "Location code"},
                "num_rows": {"type": "integer", "default": 10, "description": "Number of results"},
            },
            "required": ["scan_code"],
        },
    ),
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, yet it reveals almost nothing. It does not state whether this is read-only (implied by 'run' vs 'place_order' but not explicit), what the return format is, whether it requires an active connection, or rate limit implications. Only the domain (market) is hinted.

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 3 words, it is technically brief, but this represents under-specification rather than meaningful conciseness. The single sentence fails to earn its place by providing actionable context, making it indistinguishable from a placeholder.

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 4-parameter financial trading tool with no output schema and no annotations, the description is inadequate. It omits the scanner subscription model, the relationship to get_scanner_parameters for discovering valid codes, and what the execution actually produces (e.g., ranked lists of instruments).

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

Parameters3/5

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

Input schema has 100% description coverage. The description adds no parameter-specific context beyond the schema, but with high schema coverage, the baseline is 3. The schema adequately documents the parameters including examples for scan_code.

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 'Run a market scanner' is tautological, essentially restating the tool name with spaces. While it identifies the verb and resource, it fails to explain what a market scanner actually returns (lists of instruments, rankings) or how it differs from sibling tools like get_market_data, search_symbols, or get_historical_data.

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?

Complete absence of usage guidance. The description does not mention the critical prerequisite relationship with sibling tool get_scanner_parameters (which likely provides valid scan_code values), nor when to use this versus other data retrieval tools. No 'when-not-to-use' or alternative suggestions are provided.

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