account_get_info
Retrieve account details including status, available funds, daily profit, open positions, and portfolio type from the Finam trading platform.
Instructions
Получение информации по конкретному счету (статус и тип аккаунта, доступные средства, дневная прибыль, открытые позиции (количество, средняя цена, прибыль/убыток), тип портфеля)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/servers/account.py:13-17 (handler)MCP tool handler for account_get_info (function named get_info under account prefix). Fetches account details using Finam client.@account_mcp.tool(tags={"account"}) async def get_info() -> GetAccountResponse: """Получение информации по конкретному счету (статус и тип аккаунта, доступные средства, дневная прибыль, открытые позиции (количество, средняя цена, прибыль/убыток), тип портфеля)""" return await get_finam_client().get_account_info()
- src/tradeapi/models.py:37-47 (schema)Pydantic schema for the account information response.class GetAccountResponse(BaseModel): account_id: str type: str status: str positions: list[Position] = Field(default_factory=list) cash: list[FinamMoney] = Field(default_factory=list) open_account_date: AwareDatetime first_non_trade_date: AwareDatetime equity: FinamDecimal | None = None unrealized_profit: FinamDecimal | None = None
- src/main.py:11-15 (registration)Registers the account_mcp server with 'account' prefix, prefixing tool names (e.g., get_info becomes account_get_info).finam_mcp = FastMCP("FinamMCP", include_tags=settings.INCLUDE_SERVERS) finam_mcp.mount(account_mcp, prefix="account") finam_mcp.mount(market_data_mcp, prefix="market_data") finam_mcp.mount(assets_mcp, prefix="assets") finam_mcp.mount(order_mcp, prefix="order")
- src/tradeapi/client.py:40-44 (helper)Helper method in FinamClient that implements the core logic to retrieve account info from the API.async def get_account_info(self): account_client = self.client.account return GetAccountResponse(**await self._exec_request(account_client, BaseClient.RequestMethod.GET, f"{account_client._url}/{self.account_id}"))
- src/servers/utils.py:6-8 (helper)Utility function to retrieve the FinamClient instance from MCP context.def get_finam_client() -> FinamClient: return get_context().get_state("finam_client")