get_cashflow
Analyze cashflow by providing start and end dates in YYYY-MM-DD format to evaluate financial trends and transactions within a specified period.
Instructions
Get cashflow analysis from Monarch Money.
Args:
start_date: Start date in YYYY-MM-DD format
end_date: End date in YYYY-MM-DD format
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end_date | No | ||
| start_date | No |
Implementation Reference
- src/monarch_mcp_server/server.py:278-307 (handler)The primary handler for the 'get_cashflow' MCP tool. Registered via @mcp.tool() decorator. Defines input schema through function parameters (optional start_date and end_date strings). Executes asynchronously via _get_cashflow helper, calls MonarchMoney client's get_cashflow method with filters, returns JSON-formatted result or error message.@mcp.tool() def get_cashflow( start_date: Optional[str] = None, end_date: Optional[str] = None ) -> str: """ Get cashflow analysis from Monarch Money. Args: start_date: Start date in YYYY-MM-DD format end_date: End date in YYYY-MM-DD format """ try: async def _get_cashflow(): client = await get_monarch_client() filters = {} if start_date: filters["start_date"] = start_date if end_date: filters["end_date"] = end_date return await client.get_cashflow(**filters) cashflow = run_async(_get_cashflow()) return json.dumps(cashflow, indent=2, default=str) except Exception as e: logger.error(f"Failed to get cashflow: {e}") return f"Error getting cashflow: {str(e)}"