get_account_holdings
Retrieve detailed investment holdings for a specific account using the account ID. Ideal for tracking and analyzing portfolio data within the Monarch Money ecosystem.
Instructions
Get investment holdings for a specific account.
Args:
account_id: The ID of the investment account
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes |
Implementation Reference
- src/monarch_mcp_server/server.py:310-329 (handler)The MCP tool handler and registration for 'get_account_holdings'. This function fetches investment holdings for the specified account ID using the MonarchMoney client, formats the response as JSON, and handles errors.@mcp.tool() def get_account_holdings(account_id: str) -> str: """ Get investment holdings for a specific account. Args: account_id: The ID of the investment account """ try: async def _get_holdings(): client = await get_monarch_client() return await client.get_account_holdings(account_id) holdings = run_async(_get_holdings()) return json.dumps(holdings, indent=2, default=str) except Exception as e: logger.error(f"Failed to get account holdings: {e}") return f"Error getting account holdings: {str(e)}"