up_get_category
Retrieve category details including name and hierarchical relationships from Up Banking to organize and analyze transaction data.
Instructions
Get details about a specific category by ID, including its name and parent/child relationships.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| categoryId | Yes | The unique identifier for the category (e.g., 'restaurants-and-cafes') |
Implementation Reference
- src/index.ts:473-484 (handler)MCP tool handler for 'up_get_category': extracts categoryId from arguments, calls UpApiClient.getCategory(), and returns the JSON-formatted result as text content.case "up_get_category": { const args = request.params.arguments as { categoryId: string }; const result = await client.getCategory(args.categoryId); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:334-349 (registration)Registration of the 'up_get_category' tool in the TOOLS array, including name, description, and input schema.{ name: "up_get_category", description: "Get details about a specific category by ID, including its name and parent/child relationships.", inputSchema: { type: "object", properties: { categoryId: { type: "string", description: "The unique identifier for the category (e.g., 'restaurants-and-cafes')", }, }, required: ["categoryId"], }, },
- src/index.ts:212-214 (helper)UpApiClient helper method implementing the core logic: makes an authenticated GET request to the Up API /categories/{categoryId} endpoint.async getCategory(categoryId: string): Promise<{ data: CategoryResource }> { return this.makeRequest(`/categories/${categoryId}`); }
- src/index.ts:75-95 (schema)TypeScript interface defining the structure of a CategoryResource object returned by the Up API.interface CategoryResource { type: "categories"; id: string; attributes: { name: string; }; relationships: { parent: { data: { type: "categories"; id: string; } | null; }; children: { data: Array<{ type: "categories"; id: string; }>; }; }; }