Skip to main content
Glama
whitebirchio

Monarch Money MCP Server

by whitebirchio

get_monthly_summary

Retrieve monthly financial overview showing income, expenses, and savings for specified year and month.

Instructions

Get monthly financial summary including income, expenses, and savings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYesYear (e.g., 2024)
monthYesMonth (1-12)

Implementation Reference

  • The actual implementation of getMonthlySummary that fetches transactions for a given month/year and calculates total income, expenses, and net savings
    private async getMonthlySummary(year: number, month: number): Promise<any> { try { const startDate = `${year}-${month.toString().padStart(2, '0')}-01`; const endDate = new Date(year, month, 0).toISOString().split('T')[0]; // Last day of month const transactions = await this.api.getTransactions({ startDate, endDate, limit: 5000, }); let totalIncome = 0; let totalExpenses = 0; const incomeTransactions: Transaction[] = []; const expenseTransactions: Transaction[] = []; transactions?.forEach((transaction: Transaction) => { if (transaction.amount > 0) { totalIncome += transaction.amount; incomeTransactions.push(transaction); } else { totalExpenses += Math.abs(transaction.amount); expenseTransactions.push(transaction); } }); const netSavings = totalIncome - totalExpenses; return { success: true, data: { month, year, totalIncome, totalExpenses, netSavings, transactionCount: transactions?.length || 0, incomeTransactionCount: incomeTransactions.length, expenseTransactionCount: expenseTransactions.length, }, summary: `${year}-${month .toString() .padStart(2, '0')}: Income $${totalIncome.toFixed( 2 )}, Expenses $${totalExpenses.toFixed(2)}, Net $${netSavings.toFixed( 2 )}`, }; } catch (error) { throw new Error( `Failed to get monthly summary: ${ error instanceof Error ? error.message : 'Unknown error' }` ); } }
  • Tool definition with input schema requiring year and month parameters
    name: 'get_monthly_summary', description: 'Get monthly financial summary including income, expenses, and savings', inputSchema: { type: 'object', properties: { year: { type: 'number', description: 'Year (e.g., 2024)', }, month: { type: 'number', description: 'Month (1-12)', }, }, required: ['year', 'month'], }, },
  • src/tools.ts:227-228 (registration)
    Tool registration case in executeTool switch statement that routes calls to getMonthlySummary implementation
    case 'get_monthly_summary': return await this.getMonthlySummary(args.year, args.month);

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