Skip to main content
Glama
jeangnc

YNAB MCP Server

by jeangnc

list_accounts

Retrieve all accounts for a YNAB budget to view account names, types, balances, and status. Use this tool to manage your budget by accessing detailed account information.

Instructions

Get all accounts for a budget. Returns account names, types, balances, and status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idYesThe budget ID

Implementation Reference

  • Handles the "list_accounts" tool call by validating input with BudgetIdSchema and invoking the YNABClient.listAccounts method.
    case "list_accounts": {
      const { budget_id } = BudgetIdSchema.parse(args);
      result = await client.listAccounts(budget_id);
      break;
    }
  • Zod schema used to validate the budget_id input parameter for the list_accounts tool.
    const BudgetIdSchema = z.object({
      budget_id: z.string().describe("The budget ID (use 'last-used' for most recent)"),
    });
  • src/index.ts:171-181 (registration)
    Registers the "list_accounts" tool with its metadata for the MCP list_tools request.
    {
      name: "list_accounts",
      description: "Get all accounts for a budget. Returns account names, types, balances, and status.",
      inputSchema: {
        type: "object" as const,
        properties: {
          budget_id: { type: "string", description: "The budget ID" },
        },
        required: ["budget_id"],
      },
    },
  • YNABClient helper method that fetches the list of accounts via the YNAB API for the given budget.
    async listAccounts(budgetId: string) {
      return this.request<{ accounts: any[] }>(`/budgets/${budgetId}/accounts`);
    }

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

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