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
| Name | Required | Description | Default |
|---|---|---|---|
| budget_id | Yes | The budget ID | |
| transaction_id | Yes | The transaction ID |
Implementation Reference
- src/index.ts:94-96 (handler)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}`); }
- src/index.ts:139-142 (schema)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"], }, },
- src/index.ts:361-365 (handler)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; }