Skip to main content
Glama
calebl

YNAB MCP Server

by calebl

List Budgets

ynab_list_budgets

Retrieve all available budgets from YNAB to view and manage your financial planning data through the YNAB MCP Server.

Instructions

Lists all available budgets from YNAB API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that executes the tool: fetches and lists YNAB budgets, formats as JSON, handles missing token and errors.
    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) }]
        };
      }
    }
  • src/index.ts:33-37 (registration)
    Registers the 'ynab_list_budgets' tool with the MCP server, using imported name, description, schema, and execute function.
    server.registerTool(ListBudgetsTool.name, {
      title: "List Budgets",
      description: ListBudgetsTool.description,
      inputSchema: ListBudgetsTool.inputSchema,
    }, async (input) => ListBudgetsTool.execute(input, api));
  • Tool metadata: name, description, and input schema (empty object).
    export const name = "ynab_list_budgets";
    export const description = "Lists all available budgets from YNAB API";
    export const inputSchema = {};
  • Imports for schema validation (zod), YNAB API client, and error handling utility.
    import { z } from "zod";
    import * as ynab from "ynab";
    import { getErrorMessage } from "./errorUtils.js";
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Lists' implies a read-only operation, it doesn't specify whether this requires authentication, returns paginated results, or has rate limits. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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, efficient sentence that directly states the tool's function without any fluff. It's appropriately sized for a simple list operation and front-loads the core purpose immediately.

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 simple list tool with no parameters and no output schema, the description is minimally adequate. However, without annotations or output schema, it doesn't address authentication needs, return format, or error handling. Given the low complexity, it's complete enough but lacks depth for robust agent use.

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 tool has 0 parameters, and schema description coverage is 100%, so there are no parameters to document. The description appropriately doesn't mention any parameters, which aligns with the input schema. A baseline of 4 is applied for zero-parameter tools.

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 ('Lists') and resource ('all available budgets from YNAB API'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'ynab_budget_summary' which might provide more detailed budget information rather than just listing them.

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. It doesn't mention prerequisites like authentication, nor does it compare with siblings like 'ynab_budget_summary' for different use cases. The agent must 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/calebl/ynab-mcp-server'

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