From bb38e2441d1bf073cbb9456b803925cc650ec332 Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 25 Dec 2025 04:24:52 +0000 Subject: [PATCH] fix: disable goals queries in get_budgets to work around Monarch API errors The Monarch Money API returns errors for goals-related GraphQL fields (lines 119-131 in query). Setting use_legacy_goals=False and use_v2_goals=False skips these problematic fields while still returning budget data. --- src/monarch_mcp_custom/server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/monarch_mcp_custom/server.py b/src/monarch_mcp_custom/server.py index 9d68d1a..446f83d 100644 --- a/src/monarch_mcp_custom/server.py +++ b/src/monarch_mcp_custom/server.py @@ -112,7 +112,9 @@ async def get_budgets(reason: Optional[str] = None) -> str: client = await get_authenticated_client() try: - budgets = await client.get_budgets() + # Disable both legacy and v2 goals to avoid API errors with goals fields + # The Monarch API appears to have issues with goals-related GraphQL fields + budgets = await client.get_budgets(use_legacy_goals=False, use_v2_goals=False) except Exception as e: error_msg = str(e) # Check if this is a Monarch API error about budgets not being set up @@ -120,7 +122,7 @@ async def get_budgets(reason: Optional[str] = None) -> str: return serialize_json( { "error": "Budget data unavailable", - "detail": "The Monarch Money API returned an error. This may occur if budgets are not configured in your account.", + "detail": "The Monarch Money API returned an error. This may be a temporary API issue.", "raw_error": error_msg, } )