Skip to main content
Glama
FinamWeb

Finam MCP Server

by FinamWeb

market_data_get_order_book

Retrieve current order book data for financial instruments on Russian markets to analyze bid-ask spreads and market depth.

Instructions

Получение текущего стакана по инструменту

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYessymbol в формате: SYMBOL@MIC (например, YDEX@MISX)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
orderbookYes

Implementation Reference

  • The handler function `get_order_book` that implements the core logic of fetching the order book data for a given symbol via the Finam client. Due to the 'market_data' prefix on the MCP server, the tool is exposed as 'market_data_get_order_book'.
    @market_data_mcp.tool(tags={"market_data"})
    async def get_order_book(symbol: Symbol) -> OrderBookResponse:
        """Получение текущего стакана по инструменту"""
        return await get_finam_client().get_order_book(symbol)
  • src/main.py:13-13 (registration)
    Registers the market_data_mcp server under the 'market_data' prefix, which prefixes all its tools including 'get_order_book' to become 'market_data_get_order_book'.
    finam_mcp.mount(market_data_mcp, prefix="market_data")
  • Pydantic schema for the 'symbol' input parameter used in the tool, providing validation, description, and examples.
    Symbol: type[str] = Annotated[
        str,
        Field(
            description="symbol в формате: SYMBOL@MIC (например, YDEX@MISX)",
            pattern=r"^[A-Z0-9]+@[A-Z]+$",  # Regex валидация
            examples=["YDEX@MISX", "SBER@TQBR"]
        )
    ]
  • Utility function to retrieve the FinamClient instance from the MCP context, used by the handler.
    def get_finam_client() -> FinamClient:
        return get_context().get_state("finam_client")
  • Registers the 'get_order_book' function as an MCP tool on the market_data_mcp server with 'market_data' tag.
    @market_data_mcp.tool(tags={"market_data"})
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While it indicates this is a read operation ('Получение' - getting), it doesn't mention important behavioral aspects like whether this requires authentication, rate limits, what format the order book data returns, or any constraints on symbol availability. The description is minimal and lacks behavioral context.

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

Conciseness5/5

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

The description is extremely concise - a single Russian phrase that directly states the tool's purpose. There's zero wasted language, and it's front-loaded with the essential information. Every word earns its place in this minimal description.

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

Completeness3/5

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

Given that this is a read operation with one well-documented parameter and an output schema exists (which handles return values), the description is minimally adequate. However, for a market data tool that likely has behavioral constraints (rate limits, authentication needs, symbol availability), the description should provide more context about these aspects since no annotations are present.

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?

The description doesn't add any parameter information beyond what's already in the schema. With 100% schema description coverage and a well-documented 'symbol' parameter that includes description, examples, and pattern, the schema does all the work. The baseline score of 3 is appropriate since the description doesn't compensate but doesn't need to given the comprehensive schema.

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 'Получение текущего стакана по инструменту' (Getting the current order book for an instrument) clearly states the verb ('Получение' - getting) and resource ('стакана по инструменту' - order book for an instrument). It's specific about what data is retrieved, though it doesn't explicitly differentiate from siblings like 'market_data_get_last_quote' or 'market_data_get_last_trades' beyond the obvious 'order book' vs 'quote/trades' distinction.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when this tool is appropriate compared to other market data tools like 'market_data_get_bars' or 'market_data_get_last_quote', nor does it specify any prerequisites or exclusions for its use.

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/FinamWeb/finam-mcp'

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