Skip to main content
Glama
whitebirchio

Monarch Money MCP Server

by whitebirchio

get_budget_summary

Retrieve current budget summary showing planned versus actual spending to monitor financial progress.

Instructions

Get current budget summary showing planned vs actual spending

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler implementation for get_budget_summary tool. Calls api.getBudgets() and returns budget information with a success status, data, and summary message.
    private async getBudgetSummary(): Promise<any> {
      try {
        const budgets = await this.api.getBudgets();
    
        return {
          success: true,
          data: budgets,
          summary: `Retrieved budget information for ${
            budgets?.length || 0
          } categories`,
        };
      } catch (error) {
        throw new Error(
          `Failed to get budget summary: ${
            error instanceof Error ? error.message : 'Unknown error'
          }`
        );
      }
    }
  • src/tools.ts:85-93 (registration)
    Tool registration definition for get_budget_summary with name, description, and input schema (no required parameters).
      name: 'get_budget_summary',
      description:
        'Get current budget summary showing planned vs actual spending',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
    },
  • src/tools.ts:218-219 (registration)
    Case statement in executeTool switch that routes 'get_budget_summary' tool calls to the getBudgetSummary() handler method.
    case 'get_budget_summary':
      return await this.getBudgetSummary();
  • Budget interface defining the structure of budget data returned by the API, including id, name, amount, spent, and remaining fields.
    export interface Budget {
      id: string;
      name: string;
      amount: number;
      spent: number;
      remaining: number;
    }
  • Underlying API implementation that fetches budget data from Monarch Money via GraphQL query, calculating planned vs actual spending for the current month.
    async getBudgets(): Promise<Budget[]> {
      const query = `
        query Common_GetJointPlanningData($startDate: Date!, $endDate: Date!) {
          budgetSystem
          budgetData(startMonth: $startDate, endMonth: $endDate) {
            monthlyAmountsByCategory {
              category {
                id
                name
                __typename
              }
              monthlyAmounts {
                month
                plannedAmount
                actualAmount
                __typename
              }
              __typename
            }
            __typename
          }
        }
      `;
    
      const now = new Date();
      const startDate = new Date(now.getFullYear(), now.getMonth(), 1)
        .toISOString()
        .split('T')[0];
      const endDate = new Date(now.getFullYear(), now.getMonth() + 1, 0)
        .toISOString()
        .split('T')[0];
    
      try {
        const data: any = await this.graphQLClient.request(query, {
          startDate,
          endDate,
        });
        const categoryData = data.budgetData?.monthlyAmountsByCategory || [];
    
        return categoryData.map((catData: any) => {
          const currentMonth = catData.monthlyAmounts?.find(
            (ma: any) => ma.month === startDate.substring(0, 7)
          );
          return {
            id: catData.category?.id,
            name: catData.category?.name,
            amount: currentMonth?.plannedAmount || 0,
            spent: currentMonth?.actualAmount || 0,
            remaining:
              (currentMonth?.plannedAmount || 0) -
              (currentMonth?.actualAmount || 0),
          };
        });
      } catch (error: any) {
        if (
          error.message.includes('401') ||
          error.message.includes('unauthorized')
        ) {
          throw new Error(
            'Authentication failed. Please check your MONARCH_TOKEN environment variable.'
          );
        }
        throw new Error(`Failed to get budgets: ${error.message}`);
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a 'Get' operation implying read-only access, but doesn't mention authentication requirements, rate limits, data freshness, or what happens if no budget data exists. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that communicates the essential purpose without wasted words. It's front-loaded with the core action and immediately specifies what kind of summary it provides. Every word earns its place in this compact description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter read tool with no output schema, the description adequately covers the basic purpose but lacks important context. It doesn't explain what format the summary returns, whether it includes time periods, or how 'planned vs actual' is calculated. Given the complexity of budget data and absence of both annotations and output schema, more completeness would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters with 100% schema description coverage, so the schema already fully documents the parameter situation. The description appropriately doesn't discuss parameters since none exist. It earns a 4 rather than 5 because while it correctly avoids parameter discussion, it doesn't explicitly note the parameter-free nature which could help the agent.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('current budget summary') with specific content ('planned vs actual spending'). It distinguishes from siblings like get_monthly_summary or get_spending_by_category by focusing on budget planning metrics rather than historical summaries or categorical breakdowns. However, it doesn't explicitly contrast with all siblings, keeping it at a 4 rather than 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like get_monthly_summary or get_spending_by_category. It doesn't mention prerequisites, timing considerations, or use-case scenarios. The agent must infer usage from the tool name and description alone without explicit direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/whitebirchio/monarch-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server