Skip to main content
Glama
whitebirchio

Monarch Money MCP Server

by whitebirchio

get_categories

Retrieve all transaction categories from Monarch Money to organize and analyze financial data for budgeting and spending insights.

Instructions

Get all transaction categories available in Monarch Money

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that executes the get_categories tool. It calls the API, handles errors, and returns a formatted response with success status, data, and summary.
    private async getCategories(): Promise<any> { try { const categories = await this.api.getCategories(); return { success: true, data: categories, summary: `Retrieved ${categories?.length || 0} transaction categories`, }; } catch (error) { throw new Error( `Failed to get categories: ${ error instanceof Error ? error.message : 'Unknown error' }` ); } }
  • src/tools.ts:150-159 (registration)
    Tool registration in getToolDefinitions() that defines the get_categories tool with its name, description, and input schema (no input parameters required).
    { name: 'get_categories', description: 'Get all transaction categories available in Monarch Money', inputSchema: { type: 'object', properties: {}, required: [], }, },
  • src/tools.ts:230-231 (registration)
    Routing logic in executeTool() that maps the 'get_categories' tool name to the getCategories() handler method.
    case 'get_categories': return await this.getCategories();
  • The underlying API method that executes a GraphQL query to fetch categories from Monarch Money API. Includes the GraphQL query definition and error handling.
    async getCategories(): Promise<any[]> { const query = ` query GetCategories { categories { id name systemCategory group { id name } } } `; try { const data: any = await this.graphQLClient.request(query); return data.categories || []; } 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 categories: ${error.message}`); } }

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