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
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | symbol в формате: SYMBOL@MIC (например, YDEX@MISX) |
Implementation Reference
- src/servers/assets.py:17-20 (handler)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")
- src/tradeapi/models.py:8-15 (schema)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"] ) ]
- src/tradeapi/models.py:25-34 (schema)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
- src/tradeapi/client.py:65-69 (helper)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}))