account_get_trades
Retrieve account trade history from the Finam trading platform by specifying date ranges and result limits for transaction analysis.
Instructions
Получение истории по сделкам аккаунта
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| start_time | Yes | ||
| end_time | Yes | ||
| limit | No |
Implementation Reference
- src/servers/account.py:26-29 (handler)The FastMCP tool handler for 'get_trades', which due to the 'account' prefix becomes the 'account_get_trades' tool. It delegates to the FinamClient.get_trades method.@account_mcp.tool(tags={"account"}) async def get_trades(start_time: AwareDatetime, end_time: AwareDatetime, limit: int = 10) -> GetTradesResponse: """Получение истории по сделкам аккаунта""" return await get_finam_client().get_trades(start_time, end_time, limit)
- src/main.py:12-12 (registration)Mounting the account_mcp server with 'account' prefix onto the main FinamMCP server, prefixing its tools (e.g., 'get_trades' -> 'account_get_trades').finam_mcp.mount(account_mcp, prefix="account")
- src/servers/account.py:26-26 (registration)Registration of the 'get_trades' tool on the account_mcp FastMCP instance using the @tool decorator.@account_mcp.tool(tags={"account"})
- src/tradeapi/client.py:50-54 (helper)Helper method in FinamClient that implements the core logic for fetching trades by wrapping the finam_trade_api client call.async def get_trades(self, start_time: datetime, end_time: datetime, limit: int = 10): return await self.client.account.get_trades( GetTradesRequest(account_id=self.account_id, start_time=start_time.isoformat(), end_time=end_time.isoformat(), limit=limit))
- src/tradeapi/models.py:18-23 (schema)Pydantic model used for the input parameters to the underlying API client for get_trades.class GetTradesRequest(GetTransactionsRequest): account_id: str start_time: str end_time: str limit: int