Skip to main content
Glama
calebl

YNAB MCP Server

by calebl

List Budgets

ynab_list_budgets

Retrieve a list of all budgets from your YNAB account to view and manage your financial plans.

Instructions

Lists all available budgets from YNAB API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handles the core logic of listing budgets from the YNAB API, returning the list or an error message.
    export async function execute(_input: Record<string, unknown>, api: ynab.API) {
      try {
        if (!process.env.YNAB_API_TOKEN) {
          return {
            content: [{ type: "text" as const, text: "YNAB API Token is not set" }]
          };
        }
    
        console.error("Listing budgets");
        const budgetsResponse = await api.budgets.getBudgets();
        console.error(`Found ${budgetsResponse.data.budgets.length} budgets`);
    
        const budgets = budgetsResponse.data.budgets.map((budget) => ({
          id: budget.id,
          name: budget.name,
        }));
    
        return {
          content: [{ type: "text" as const, text: JSON.stringify(budgets, null, 2) }]
        };
      } catch (error: unknown) {
        console.error("Error listing budgets:", error);
        return {
          content: [{ type: "text" as const, text: JSON.stringify({
            success: false,
            error: getErrorMessage(error),
          }, null, 2) }]
        };
      }
    }
  • Defines the tool name 'ynab_list_budgets', description, and empty input schema (no parameters needed).
    export const name = "ynab_list_budgets";
    export const description = "Lists all available budgets from YNAB API";
    export const inputSchema = {};
  • src/index.ts:33-37 (registration)
    Registers the ListBudgetsTool with the MCP server using its name, description, input schema, and execute handler.
    server.registerTool(ListBudgetsTool.name, {
      title: "List Budgets",
      description: ListBudgetsTool.description,
      inputSchema: ListBudgetsTool.inputSchema,
    }, async (input) => ListBudgetsTool.execute(input, api));
Behavior2/5

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

With no annotations provided, the description carries the full burden. It only states 'lists budgets' but does not disclose whether the operation is read-only, whether authentication is required, or any pagination or filtering behavior. For a simple list, the lack of explicit transparency is a gap.

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 a single 8-word sentence, extremely concise with no unnecessary verbiage. Every word earns its place.

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

Completeness2/5

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

The tool lacks an output schema and has no annotations. The description does not hint at what information is returned for each budget (e.g., id, name, currency). For a tool with zero parameters and simple behavior, the absence of return value details makes it incomplete for an agent to understand what to expect.

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?

The input schema has zero parameters, so baseline is 4. The description adds no parameter-specific meaning, but none is needed since there are no parameters. The 100% schema coverage further reduces the need for additional description.

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 action ('Lists') and the resource ('all available budgets'), making the purpose obvious. It contrasts sufficiently with sibling tools that have different actions (e.g., create, update, delete), though it doesn't explicitly differentiate itself.

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?

No usage guidelines are provided. The description does not mention when to prefer this tool over siblings like ynab_budget_summary or ynab_get_transactions, nor does it state any prerequisites or limitations.

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/calebl/ynab-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server