Skip to main content
Glama
justmytwospence

ynab-mcp

get_account

Retrieve detailed information for a specific YNAB account, including balance and transaction history, to monitor financial status.

Instructions

[1 API call] Get details for a single account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idNoBudget ID or 'last-used'last-used
account_idYesThe account ID

Implementation Reference

  • The `get_account` tool handler implementation, including input schema definition and the logic for fetching account details from the YNAB client.
    server.registerTool("get_account", {
      title: "Get Account",
      description: "[1 API call] Get details for a single account",
      inputSchema: {
        budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"),
        account_id: z.string().describe("The account ID"),
      },
      annotations: { readOnlyHint: true },
    }, async ({ budget_id, account_id }) => {
      try {
        const response = await getClient().accounts.getAccountById(budget_id, account_id);
        const a = response.data.account;
        const lines = [
          `Name: ${a.name}`,
          `Type: ${a.type}`,
          `Balance: ${formatCurrency(a.balance)}`,
          `Cleared Balance: ${formatCurrency(a.cleared_balance)}`,
          `Uncleared Balance: ${formatCurrency(a.uncleared_balance)}`,
          `On Budget: ${a.on_budget}`,
          `Closed: ${a.closed}`,
          `Note: ${a.note ?? "None"}`,
          `ID: ${a.id}`,
        ];
        return textResult(lines.join("\n"));
      } catch (e: any) {
        return errorResult(e.message);
      }
    });

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