Skip to main content
Glama
jeangnc

YNAB MCP Server

by jeangnc

get_transaction

Retrieve detailed information about a specific transaction in YNAB by providing the budget ID and transaction ID.

Instructions

Get detailed information about a specific transaction.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idYesThe budget ID
transaction_idYesThe transaction ID

Implementation Reference

  • The core handler function in YNABClient that fetches the specific transaction from the YNAB API using the provided budgetId and transactionId.
    async getTransaction(budgetId: string, transactionId: string) {
      return this.request<{ transaction: any }>(`/budgets/${budgetId}/transactions/${transactionId}`);
    }
  • Zod schema used for input validation of budget_id and transaction_id parameters.
    const TransactionSchema = z.object({
      budget_id: z.string().describe("The budget ID"),
      transaction_id: z.string().describe("The transaction ID"),
    });
  • src/index.ts:233-244 (registration)
    Tool registration in the tools array, defining name, description, and input schema for MCP server.
    {
      name: "get_transaction",
      description: "Get detailed information about a specific transaction.",
      inputSchema: {
        type: "object" as const,
        properties: {
          budget_id: { type: "string", description: "The budget ID" },
          transaction_id: { type: "string", description: "The transaction ID" },
        },
        required: ["budget_id", "transaction_id"],
      },
    },
  • Dispatch handler in the main CallToolRequestSchema handler that validates args and invokes the getTransaction method.
    case "get_transaction": {
      const { budget_id, transaction_id } = TransactionSchema.parse(args);
      result = await client.getTransaction(budget_id, transaction_id);
      break;
    }

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