list_payees
Retrieve all payees associated with a specific budget to manage transaction recipients and track spending sources.
Instructions
[1 API call] List all payees for a budget
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| budget_id | No | Budget ID or 'last-used' | last-used |
| last_knowledge_of_server | No | Delta request token |
Implementation Reference
- src/tools/payees.ts:7-29 (handler)The handler for 'list_payees' which fetches payees from the YNAB API and formats them as a text response.
server.registerTool("list_payees", { title: "List Payees", description: "[1 API call] List all payees for a budget", inputSchema: { budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"), last_knowledge_of_server: z.number().optional().describe("Delta request token"), }, annotations: { readOnlyHint: true }, }, async ({ budget_id, last_knowledge_of_server }) => { try { const response = await getClient().payees.getPayees(budget_id, last_knowledge_of_server); const payees = response.data.payees; const lines = payees.map((p) => { const transfer = p.transfer_account_id ? ` (Transfer: ${p.transfer_account_id})` : ""; return `- ${p.name}${transfer} [ID: ${p.id}]`; }); return textResult( `Payees (${payees.length}):\n${lines.join("\n")}\n\nServer Knowledge: ${response.data.server_knowledge}` ); } catch (e: any) { return errorResult(e.message); } });