get_scheduled_transaction
Retrieve details for a specific scheduled transaction in YNAB to view upcoming payments, amounts, and categories for better budget planning.
Instructions
[1 API call] Get details for a single scheduled transaction
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| budget_id | No | Budget ID or 'last-used' | last-used |
| scheduled_transaction_id | Yes | The scheduled transaction ID |
Implementation Reference
- The handler function that executes the "get_scheduled_transaction" tool logic.
}, async ({ budget_id, scheduled_transaction_id }) => { try { const response = await getClient().scheduledTransactions.getScheduledTransactionById( budget_id, scheduled_transaction_id ); const t = response.data.scheduled_transaction; const lines = [ `Date (First): ${t.date_first}`, `Date (Next): ${t.date_next}`, `Amount: ${formatCurrency(t.amount)}`, `Frequency: ${t.frequency}`, `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"}`, `Flag: ${t.flag_color ?? "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); } }); - The input schema definition for the "get_scheduled_transaction" tool.
inputSchema: { budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"), scheduled_transaction_id: z.string().describe("The scheduled transaction ID"), }, annotations: { readOnlyHint: true }, - src/tools/scheduled-transactions.ts:41-41 (registration)Registration of the "get_scheduled_transaction" tool within the MCP server.
server.registerTool("get_scheduled_transaction", {