Skip to main content
Glama
justmytwospence

ynab-mcp

get_month_category

Retrieve a category's budget details for a specific month from YNAB to track spending and manage financial allocations.

Instructions

[1 API call] Get a category's budget details for a specific 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'
category_idYesThe category ID

Implementation Reference

  • The tool "get_month_category" is registered here with its input schema and handler function, which calls the YNAB client to retrieve budget category details for a specific month.
    server.registerTool("get_month_category", {
      title: "Get Month Category",
      description: "[1 API call] Get a category's budget details for a specific 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'"),
        category_id: z.string().describe("The category ID"),
      },
      annotations: { readOnlyHint: true },
    }, async ({ budget_id, month, category_id }) => {
      try {
        const response = await getClient().categories.getMonthCategoryById(budget_id, month, category_id);
        const c = response.data.category;
        const lines = [
          `Category: ${c.name} (${month})`,
          `Budgeted: ${formatCurrency(c.budgeted)}`,
          `Activity: ${formatCurrency(c.activity)}`,
          `Balance: ${formatCurrency(c.balance)}`,
          `Goal Type: ${c.goal_type ?? "None"}`,
          `Goal Target: ${c.goal_target != null ? formatCurrency(c.goal_target) : "None"}`,
        ];
        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