Skip to main content
Glama
justmytwospence

ynab-mcp

List Categories

list_categories
Read-only

Retrieve all budget categories organized by their groups to help users view and manage their financial allocations effectively.

Instructions

[1 API call] List all categories grouped by category group for a budget

Input Schema

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

Implementation Reference

  • The tool "list_categories" is registered and handled within the `registerCategoryTools` function. The handler function uses `getClient().categories.getCategories` to fetch and format the category list.
    server.registerTool("list_categories", {
      title: "List Categories",
      description: "[1 API call] List all categories grouped by category group for a budget",
      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 },
    }, async ({ budget_id, last_knowledge_of_server }) => {
      try {
        const response = await getClient().categories.getCategories(budget_id, last_knowledge_of_server);
        const groups = response.data.category_groups;
        const lines: string[] = [];
        for (const group of groups) {
          lines.push(`\n## ${group.name} (ID: ${group.id})`);
          if (group.categories) {
            for (const cat of group.categories) {
              if (cat.hidden) continue;
              const budgeted = formatCurrency(cat.budgeted);
              const activity = formatCurrency(cat.activity);
              const balance = formatCurrency(cat.balance);
              lines.push(`  - ${cat.name}: Budgeted ${budgeted} | Activity ${activity} | Balance ${balance} [ID: ${cat.id}]`);
            }
          }
        }
        return textResult(`Categories:${lines.join("\n")}\n\nServer Knowledge: ${response.data.server_knowledge}`);
      } catch (e: any) {
        return errorResult(e.message);
      }
    });
Behavior3/5

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

The annotation 'readOnlyHint: true' already indicates this is a safe read operation. The description adds value by specifying '[1 API call]', which informs about potential rate limits or performance, and clarifies that categories are 'grouped by category group', providing context beyond the annotations. However, it lacks details on pagination, error handling, or response format, which would enhance transparency further.

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 and front-loaded, consisting of a single sentence that efficiently conveys the core functionality and key behavioral note ('[1 API call]'). There is no wasted verbiage, and every element serves a clear purpose, making it easy for an agent to parse quickly.

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?

Given the tool's low complexity (read-only, 2 parameters with full schema coverage, no output schema), the description is somewhat complete but has gaps. It covers the basic operation and a behavioral note, but lacks details on output structure, error cases, or sibling differentiation, which could help the agent use it more effectively in context with other tools.

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 input schema fully documents both parameters ('budget_id' and 'last_knowledge_of_server'). The description does not add any additional meaning or examples for these parameters, such as explaining the 'last-used' default or the purpose of the delta token. Thus, it meets the baseline but does not compensate with extra insights.

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 verb ('List') and resource ('categories grouped by category group for a budget'), making the purpose specific and understandable. However, it does not explicitly differentiate from sibling tools like 'list_category_transactions' or 'get_category', which also involve categories, leaving some ambiguity about when to choose this tool over those alternatives.

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, such as 'get_category' for a single category or 'list_category_transactions' for transactions within categories. It mentions a budget context but does not specify prerequisites or exclusions, leaving the agent to infer usage from the tool name alone.

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