Skip to main content
Glama
justmytwospence

ynab-mcp

List Accounts

list_accounts
Read-only

Retrieve all budget accounts with current balances and account types to monitor financial positions and track spending across categories.

Instructions

[1 API call] List all accounts for a budget including balances and types

Input Schema

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

Implementation Reference

  • The 'list_accounts' tool registration and handler implementation. It uses the YNAB client to fetch accounts for a given budget and formats the result.
    server.registerTool("list_accounts", {
      title: "List Accounts",
      description: "[1 API call] List all accounts for a budget including balances and types",
      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().accounts.getAccounts(budget_id, last_knowledge_of_server);
        const accounts = response.data.accounts;
        const lines = accounts.map((a) => {
          const status = a.closed ? " [CLOSED]" : "";
          const onBudget = a.on_budget ? "On Budget" : "Off Budget";
          return `- ${a.name}${status}: ${formatCurrency(a.balance)} (${a.type}, ${onBudget}) [ID: ${a.id}]`;
        });
        return textResult(
          `Accounts (${accounts.length}):\n${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 useful context about the API call count ('[1 API call]') and what data is returned ('balances and types'), but doesn't disclose other behavioral aspects like pagination, rate limits, or authentication requirements. No contradiction with annotations exists.

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 front-loads key information (API call count, action, resource, and included data). Every element serves a purpose with zero waste, making it easy to parse quickly.

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 list tool with good annotations and full parameter documentation, the description provides adequate context by specifying the scope ('for a budget') and return data ('balances and types'). However, without an output schema, it could benefit from more detail on the response structure or pagination behavior to be fully complete.

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?

With 100% schema description coverage, the input schema fully documents both parameters ('budget_id' and 'last_knowledge_of_server'). The description doesn't add any parameter-specific semantics beyond what's in the schema, such as explaining the delta token usage or budget ID defaults. The baseline score of 3 is appropriate when the schema handles parameter documentation.

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 ('List all accounts') and resource ('for a budget'), and specifies what information is included ('balances and types'). However, it doesn't explicitly differentiate from sibling tools like 'get_account' (which retrieves a single account) or 'list_account_transactions' (which lists transactions for an account).

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

Usage Guidelines3/5

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

The description implies usage context by mentioning 'for a budget' and the API call count, but doesn't provide explicit guidance on when to use this tool versus alternatives like 'get_account' (for single account details) or 'list_account_transactions' (for account-specific transactions). No exclusions or prerequisites are mentioned.

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