get_budget
Retrieve comprehensive budget details including accounts, categories, and settings from YNAB to manage financial planning effectively.
Instructions
Get detailed information about a specific budget including accounts, categories, and settings.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| budget_id | Yes | The budget ID (use 'last-used' for most recent) |
Implementation Reference
- src/index.ts:41-43 (handler)The core handler function in the YNABClient class that fetches detailed budget information from the YNAB API using an HTTP request.async getBudget(budgetId: string) { return this.request<{ budget: any }>(`/budgets/${budgetId}`); }
- src/index.ts:319-323 (handler)The dispatch handler in the MCP CallToolRequestSchema that validates the input arguments and invokes the getBudget method.case "get_budget": { const { budget_id } = BudgetIdSchema.parse(args); result = await client.getBudget(budget_id); break; }
- src/index.ts:116-118 (schema)Zod schema defining the input validation for the budget_id parameter used in the get_budget tool.const BudgetIdSchema = z.object({ budget_id: z.string().describe("The budget ID (use 'last-used' for most recent)"), });
- src/index.ts:160-170 (registration)The tool definition object registered in the tools array, providing the name, description, and input schema for list_tools.{ name: "get_budget", description: "Get detailed information about a specific budget including accounts, categories, and settings.", inputSchema: { type: "object" as const, properties: { budget_id: { type: "string", description: "The budget ID (use 'last-used' for most recent)" }, }, required: ["budget_id"], }, },