Skip to main content
Glama
Alexander-Panov

Finam MCP Server

assets_get_params

Retrieve trading parameters for financial instruments including long/short operations, margin requirements, and risk rates from the Finam trading platform.

Instructions

Получение торговых параметров по инструменту (операции лонг/шорт, гарантийное обеспечение, ставки риска)

Input Schema

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

Implementation Reference

  • Handler function implementing the core logic of the 'assets_get_params' tool (get_params prefixed by 'assets' from server mount). Retrieves trading parameters for a given asset symbol using the FinamClient.
    @assets_mcp.tool(tags={"assets"}) async def get_params(symbol: Symbol) -> AssetParamsResponse: """Получение торговых параметров по инструменту (операции лонг/шорт, гарантийное обеспечение, ставки риска)""" return await get_finam_client().get_asset_params(symbol)
  • src/main.py:14-14 (registration)
    Registers the assets_mcp server under the 'assets' prefix on the main FinamMCP server, which prefixes all tools in assets_mcp (e.g., get_params becomes assets_get_params).
    finam_mcp.mount(assets_mcp, prefix="assets")
  • Pydantic schema for input parameter 'symbol': Annotated string with description, regex pattern validation (SYMBOL@MIC), 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"] ) ]
  • Pydantic model for the tool's output: AssetParamsResponse defining fields like tradeable status, long/short collateral and risk rates.
    class AssetParamsResponse(BaseModel): symbol: Symbol account_id: str tradeable: bool longable: Status | None = None shortable: Status | None = None long_risk_rate: FinamDecimal | None = None long_collateral: FinamMoney | None = None short_risk_rate: FinamDecimal | None = None short_collateral: FinamMoney | None = None
  • Helper method in FinamClient that performs the actual API request to retrieve asset parameters for the given symbol and account.
    async def get_asset_params(self, symbol: str): assets_client = self.client.assets return AssetParamsResponse(**await self._exec_request(assets_client, BaseClient.RequestMethod.GET, f"{assets_client._url}/{symbol}/params", params={"account_id": self.account_id}))

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

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