get_category
Retrieve current month data and details for a specific YNAB budget category to monitor spending and track financial goals.
Instructions
Get detailed information about a specific category including current month data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| budget_id | Yes | The budget ID | |
| category_id | Yes | The category ID |
Implementation Reference
- src/index.ts:57-59 (handler)The core handler function in YNABClient that performs the HTTP request to retrieve category details from the YNAB API.async getCategory(budgetId: string, categoryId: string) { return this.request<{ category: any }>(`/budgets/${budgetId}/categories/${categoryId}`); }
- src/index.ts:125-128 (schema)Zod schema for validating input parameters (budget_id and category_id) used for the get_category tool.const CategorySchema = z.object({ budget_id: z.string().describe("The budget ID"), category_id: z.string().describe("The category ID"), });
- src/index.ts:205-216 (registration)Tool definition registration in the tools array provided to list_tools request handler, including name, description, and input schema.{ name: "get_category", description: "Get detailed information about a specific category including current month data.", inputSchema: { type: "object" as const, properties: { budget_id: { type: "string", description: "The budget ID" }, category_id: { type: "string", description: "The category ID" }, }, required: ["budget_id", "category_id"], }, },
- src/index.ts:343-347 (registration)Dispatch and execution logic in the CallToolRequestSchema handler: parses args with CategorySchema and invokes the getCategory handler.case "get_category": { const { budget_id, category_id } = CategorySchema.parse(args); result = await client.getCategory(budget_id, category_id); break; }