Skip to main content
Glama
justmytwospence

ynab-mcp

Get Category

get_category
Read-only

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);
      }
    });
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds the constraint '[1 API call]' which provides useful context about efficiency/rate limits beyond the readOnlyHint annotation. However, it doesn't describe other behavioral aspects like error conditions, response format, or whether it returns nested data. With annotations covering safety, this adds some value but not rich behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise (one sentence plus API call note) with zero wasted words. It's front-loaded with the core purpose and efficiently includes the API call constraint without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only tool with good annotations and full schema coverage, the description is minimally adequate. However, without an output schema, it should ideally describe what 'details' include or the response structure. The API call note helps but doesn't fully compensate for missing output information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents both parameters (budget_id and category_id). The description doesn't add any parameter-specific information beyond what's in the schema, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get details') and resource ('a single category'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_categories' or 'get_month_category', which would have required a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'list_categories' (for multiple categories) or 'get_month_category' (for category data in a specific month). It mentions '[1 API call]' which hints at efficiency but doesn't clarify usage context or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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