Skip to main content
Glama
justmytwospence

ynab-mcp

get_category

Retrieve specific category details from a YNAB budget to view spending limits, balances, and financial tracking information.

Instructions

[1 API call] Get details for a single category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idNoBudget ID or 'last-used'last-used
category_idYesThe category ID

Implementation Reference

  • The tool "get_category" is registered and handled within this block, calling the YNAB client's `getCategoryById` method.
    server.registerTool("get_category", {
      title: "Get Category",
      description: "[1 API call] Get details for a single category",
      inputSchema: {
        budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"),
        category_id: z.string().describe("The category ID"),
      },
      annotations: { readOnlyHint: true },
    }, async ({ budget_id, category_id }) => {
      try {
        const response = await getClient().categories.getCategoryById(budget_id, category_id);
        const c = response.data.category;
        const lines = [
          `Name: ${c.name}`,
          `Category Group: ${c.category_group_name}`,
          `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"}`,
          `Goal Target Month: ${c.goal_target_month ?? "None"}`,
          `Note: ${c.note ?? "None"}`,
          `Hidden: ${c.hidden}`,
          `ID: ${c.id}`,
        ];
        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