Skip to main content
Glama
Alexander-Panov

Finam MCP Server

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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()
  • 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")
  • 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}"))
  • Utility function to retrieve the FinamClient instance from MCP context.
    def get_finam_client() -> FinamClient:
        return get_context().get_state("finam_client")

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