Skip to main content
Glama
justmytwospence

ynab-mcp

Get Transaction

get_transaction
Read-only

Retrieve specific transaction details from YNAB budgets to view spending, track expenses, or verify financial records.

Instructions

[1 API call] Get details for a single transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idNoBudget ID or 'last-used'last-used
transaction_idYesThe transaction ID

Implementation Reference

  • The handler and registration for the 'get_transaction' tool.
    server.registerTool("get_transaction", {
      title: "Get Transaction",
      description: "[1 API call] Get details for a single transaction",
      inputSchema: {
        budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"),
        transaction_id: z.string().describe("The transaction ID"),
      },
      annotations: { readOnlyHint: true },
    }, async ({ budget_id, transaction_id }) => {
      try {
        const response = await getClient().transactions.getTransactionById(budget_id, transaction_id);
        const t = response.data.transaction;
        const lines = [
          `Date: ${t.date}`,
          `Amount: ${formatCurrency(t.amount)}`,
          `Payee: ${t.payee_name ?? "None"} (ID: ${t.payee_id ?? "N/A"})`,
          `Category: ${t.category_name ?? "Uncategorized"} (ID: ${t.category_id ?? "N/A"})`,
          `Account: ${t.account_name} (ID: ${t.account_id})`,
          `Memo: ${t.memo ?? "None"}`,
          `Cleared: ${t.cleared}`,
          `Approved: ${t.approved}`,
          `Flag: ${t.flag_color ?? "None"}`,
          `Transfer Account: ${t.transfer_account_id ?? "None"}`,
          `ID: ${t.id}`,
        ];
        if (t.subtransactions && t.subtransactions.length > 0) {
          lines.push(`\nSplit Transactions:`);
          for (const sub of t.subtransactions) {
            lines.push(`  - ${formatCurrency(sub.amount)} | ${sub.category_name ?? "Uncategorized"} | ${sub.memo ?? ""}`);
          }
        }
        return textResult(lines.join("\n"));
      } catch (e: any) {
        return errorResult(e.message);
      }
    });
Behavior3/5

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

The description adds the '[1 API call]' detail, which is useful context beyond the readOnlyHint annotation (which already indicates it's a safe read operation). However, it doesn't disclose other behavioral traits like error handling, response format, or any rate limits, leaving gaps in understanding how the tool behaves in practice.

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 extremely concise—just one sentence with a bracketed note—and front-loaded with the core purpose. Every word earns its place, making it easy to parse without unnecessary elaboration.

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?

Given the tool's low complexity (a simple read operation), high schema coverage, and readOnlyHint annotation, the description is minimally adequate. However, without an output schema, it doesn't explain what details are returned (e.g., transaction fields), which could hinder the agent's ability to use the results effectively.

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 transaction_id), including defaults and requirements. The description adds no additional parameter semantics, so it meets the baseline of 3 by not detracting from the schema's completeness.

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 ('Get details') and resource ('single transaction'), making the purpose understandable. However, it doesn't differentiate this tool from similar siblings like 'list_transactions' or 'get_account', which also retrieve data but for different resources or scopes.

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. With many sibling tools like 'list_transactions' (for multiple transactions) and 'get_account' (for account details), it's unclear when this specific single-transaction retrieval is preferred, leaving the agent to guess based on context.

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