Skip to main content
Glama
justmytwospence

ynab-mcp

Get Budget

get_budget
Read-only

Retrieve detailed information for a specific YNAB budget, including all accounts, categories, and transactions. Use 'last-used' to access your most recent budget or specify a budget ID.

Instructions

[1 API call] Get a single budget's full detail including all entities. Use 'last-used' for the most recently accessed budget.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idNoBudget ID or 'last-used'last-used
last_knowledge_of_serverNoDelta request - only return entities changed since this server knowledge value

Implementation Reference

  • The handler function for "get_budget" tool, which uses the YNAB client to fetch budget details.
    server.registerTool("get_budget", {
      title: "Get Budget",
      description: "[1 API call] Get a single budget's full detail including all entities. Use 'last-used' for the most recently accessed 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 - only return entities changed since this server knowledge value"),
      },
      annotations: { readOnlyHint: true },
    }, async ({ budget_id, last_knowledge_of_server }) => {
      try {
        const response = await getClient().plans.getPlanById(budget_id, last_knowledge_of_server);
        const b = response.data.plan;
        const summary = [
          `Budget: ${b.name}`,
          `ID: ${b.id}`,
          `Last Modified: ${b.last_modified_on}`,
          `Accounts: ${b.accounts?.length ?? 0}`,
          `Categories: ${b.categories?.length ?? 0}`,
          `Payees: ${b.payees?.length ?? 0}`,
          `Transactions: ${b.transactions?.length ?? 0}`,
          `Scheduled Transactions: ${b.scheduled_transactions?.length ?? 0}`,
          `Server Knowledge: ${response.data.server_knowledge}`,
        ];
        return textResult(summary.join("\n"));
      } catch (e: any) {
        return errorResult(e.message);
      }
    });
Behavior4/5

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

The description adds valuable behavioral context beyond the readOnlyHint annotation by specifying '[1 API call]' which indicates resource usage/rate limit implications, and explains the special 'last-used' parameter behavior. While it doesn't describe return format or pagination, it provides useful operational context that annotations don't cover.

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 perfectly concise with two sentences that each earn their place: the first establishes the core functionality and API cost, the second provides critical usage guidance. No wasted words, front-loaded with essential information.

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

Completeness4/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 provides adequate context about what the tool returns ('full detail including all entities') and operational considerations. The main gap is lack of output format details, but given the readOnlyHint annotation and clear purpose, this is reasonably complete.

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

Parameters4/5

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

With 100% schema description coverage, the baseline would be 3, but the description adds meaningful context about the 'last-used' parameter that enhances understanding beyond the schema's technical description. It explains the practical meaning and use case for this special value, which adds semantic value.

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

Purpose5/5

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

The description clearly states the specific action ('Get'), resource ('a single budget's full detail'), and scope ('including all entities'), distinguishing it from sibling tools like 'list_budgets' which would return multiple budgets. It provides a complete picture of what the tool does beyond just the name/title.

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

Usage Guidelines5/5

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

The description explicitly provides usage guidance by stating 'Use 'last-used' for the most recently accessed budget,' which tells the agent when to use this specific parameter value. It also implicitly distinguishes from 'list_budgets' by focusing on single budget retrieval rather than listing multiple budgets.

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