market_data_get_last_quote
Retrieve the most recent quote for a financial instrument, including bid/ask prices, open/close values, last trade price, and daily trading volumes.
Instructions
получение последней котировки инструмента (цена покупки/продажи, цена открытия/закрытия, цена последней сделки, дневной объем сделок, объем покупки/продажи)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | symbol в формате: SYMBOL@MIC (например, YDEX@MISX) |
Implementation Reference
- src/servers/market_data.py:19-22 (handler)The core handler function for the 'market_data_get_last_quote' tool (prefixed from 'get_last_quote'). It retrieves the last quote using the Finam client.@market_data_mcp.tool(tags={"market_data"}) async def get_last_quote(symbol: Symbol) -> QuoteResponse: """получение последней котировки инструмента (цена покупки/продажи, цена открытия/закрытия, цена последней сделки, дневной объем сделок, объем покупки/продажи)""" return await get_finam_client().get_last_quote(symbol)
- src/main.py:13-13 (registration)Mounts the market_data_mcp FastMCP instance with 'market_data' prefix, enabling tool names like 'market_data_get_last_quote'.finam_mcp.mount(market_data_mcp, prefix="market_data")
- src/tradeapi/models.py:8-15 (schema)Pydantic schema definition for the 'symbol' input parameter used in the tool.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"] ) ]
- src/servers/utils.py:6-8 (helper)Utility function to obtain the FinamClient instance from the MCP context, used by the handler.def get_finam_client() -> FinamClient: return get_context().get_state("finam_client")