Skip to main content
Glama
justmytwospence

ynab-mcp

list_months

Retrieve budget month details including income, budgeted amounts, activity, and ready-to-assign funds for YNAB financial planning.

Instructions

[1 API call] List all budget months for a budget, showing income, budgeted, activity, and ready to assign

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idNoBudget ID or 'last-used'last-used
last_knowledge_of_serverNoDelta request token

Implementation Reference

  • The handler function that executes the logic for the "list_months" tool. It calls the YNAB client to fetch plan months and formats the output.
    }, async ({ budget_id, last_knowledge_of_server }) => {
      try {
        const response = await getClient().months.getPlanMonths(budget_id, last_knowledge_of_server);
        const months = response.data.months;
        const lines = months.map((m) =>
          `- ${m.month}: Income ${formatCurrency(m.income)} | Budgeted ${formatCurrency(m.budgeted)} | Activity ${formatCurrency(m.activity)} | To Be Budgeted ${formatCurrency(m.to_be_budgeted)}`
        );
        return textResult(
          `Budget Months (${months.length}):\n${lines.join("\n")}\n\nServer Knowledge: ${response.data.server_knowledge}`
        );
      } catch (e: any) {
        return errorResult(e.message);
      }
    });
  • The registration of the "list_months" tool, including its schema and description.
    server.registerTool("list_months", {
      title: "List Budget Months",
      description: "[1 API call] List all budget months for a budget, showing income, budgeted, activity, and ready to assign",
      inputSchema: {
        budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"),
        last_knowledge_of_server: z.number().optional().describe("Delta request token"),
      },
      annotations: { readOnlyHint: true },

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

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