Skip to main content
Glama
justmytwospence

ynab-mcp

get_month

Retrieve detailed budget month information including all category balances from YNAB. Specify a month in YYYY-MM-DD format or use 'current' for the present month.

Instructions

[1 API call] Get detailed info for a single budget month including all category balances. Use 'current' for the current month.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idNoBudget ID or 'last-used'last-used
monthYesMonth in YYYY-MM-DD format (first of month) or 'current'

Implementation Reference

  • The "get_month" tool handler, which retrieves detailed budget month information including category balances from the YNAB API.
    server.registerTool("get_month", {
      title: "Get Budget Month",
      description: "[1 API call] Get detailed info for a single budget month including all category balances. Use 'current' for the current month.",
      inputSchema: {
        budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"),
        month: z.string().describe("Month in YYYY-MM-DD format (first of month) or 'current'"),
      },
      annotations: { readOnlyHint: true },
    }, async ({ budget_id, month }) => {
      try {
        const response = await getClient().months.getPlanMonth(budget_id, month);
        const m = response.data.month;
        const lines = [
          `Month: ${m.month}`,
          `Income: ${formatCurrency(m.income)}`,
          `Budgeted: ${formatCurrency(m.budgeted)}`,
          `Activity: ${formatCurrency(m.activity)}`,
          `To Be Budgeted: ${formatCurrency(m.to_be_budgeted)}`,
          `Age of Money: ${m.age_of_money ?? "N/A"} days`,
        ];
        if (m.categories) {
          lines.push(`\nCategories:`);
          for (const c of m.categories) {
            if (c.hidden) continue;
            lines.push(`  - ${c.name}: Budgeted ${formatCurrency(c.budgeted)} | Activity ${formatCurrency(c.activity)} | Balance ${formatCurrency(c.balance)}`);
          }
        }
        return textResult(lines.join("\n"));
      } catch (e: any) {
        return errorResult(e.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/justmytwospence/ynab-mcp'

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