get_payee_locations_for_payee
Retrieve GPS locations for a specific payee in YNAB to track transaction geography and enhance budget accuracy.
Instructions
[1 API call] Get all GPS locations for a specific payee
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| budget_id | No | Budget ID or 'last-used' | last-used |
| payee_id | Yes | The payee ID |
Implementation Reference
- src/tools/payee-locations.ts:48-68 (handler)The tool 'get_payee_locations_for_payee' is registered and implemented in the same block, using 'getClient().payeeLocations.getPayeeLocationsByPayee' to fetch data.
server.registerTool("get_payee_locations_for_payee", { title: "Get Locations for Payee", description: "[1 API call] Get all GPS locations for a specific payee", inputSchema: { budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"), payee_id: z.string().describe("The payee ID"), }, annotations: { readOnlyHint: true }, }, async ({ budget_id, payee_id }) => { try { const response = await getClient().payeeLocations.getPayeeLocationsByPayee(budget_id, payee_id); const locations = response.data.payee_locations; if (locations.length === 0) return textResult("No locations found for this payee."); const lines = locations.map((l) => `- (${l.latitude}, ${l.longitude}) [ID: ${l.id}]` ); return textResult(`Locations for payee ${payee_id}:\n${lines.join("\n")}`); } catch (e: any) { return errorResult(e.message); } });