Skip to main content
Glama
jeangnc

YNAB MCP Server

by jeangnc

list_months

Retrieve all budget months with summaries showing income, budgeted amounts, and activity totals for YNAB budget management.

Instructions

Get all budget months. Returns month summaries with income, budgeted, and activity totals.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idYesThe budget ID

Implementation Reference

  • The core handler function in the YNABClient class that fetches the list of months for a given budget from the YNAB API.
    async listMonths(budgetId: string) { return this.request<{ months: any[] }>(`/budgets/${budgetId}/months`); }
  • Zod schema used for input validation of budget_id parameter in the list_months tool handler.
    const BudgetIdSchema = z.object({ budget_id: z.string().describe("The budget ID (use 'last-used' for most recent)"), });
  • src/index.ts:267-277 (registration)
    Registration of the list_months tool in the tools array provided to the MCP ListToolsRequest, including name, description, and input schema.
    { name: "list_months", description: "Get all budget months. Returns month summaries with income, budgeted, and activity totals.", inputSchema: { type: "object" as const, properties: { budget_id: { type: "string", description: "The budget ID" }, }, required: ["budget_id"], }, },
  • Dispatch logic in the MCP CallToolRequest handler that validates input and invokes the list_months implementation.
    case "list_months": { const { budget_id } = BudgetIdSchema.parse(args); result = await client.listMonths(budget_id); break; }

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/jeangnc/ynab-mcp-server'

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