up_list_categories
Retrieve all spending categories with parent-child relationships to identify category IDs for filtering transactions in Up Banking.
Instructions
List all spending categories in Up. Categories have a parent-child relationship. Use this to understand category IDs for filtering transactions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| parentId | No | Optional: Filter to only show children of a specific parent category |
Implementation Reference
- src/index.ts:460-471 (handler)MCP server request handler case for 'up_list_categories' tool. Extracts arguments, calls UpApiClient.listCategories, and returns the result as JSON text content.case "up_list_categories": { const args = request.params.arguments as { parentId?: string }; const result = await client.listCategories(args); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:323-332 (schema)Input schema definition for the 'up_list_categories' tool, specifying optional 'parentId' parameter.inputSchema: { type: "object", properties: { parentId: { type: "string", description: "Optional: Filter to only show children of a specific parent category", }, }, },
- src/index.ts:319-333 (registration)Tool object registration in the TOOLS array used by ListToolsRequestSchema handler.{ name: "up_list_categories", description: "List all spending categories in Up. Categories have a parent-child relationship. Use this to understand category IDs for filtering transactions.", inputSchema: { type: "object", properties: { parentId: { type: "string", description: "Optional: Filter to only show children of a specific parent category", }, }, }, },
- src/index.ts:195-210 (helper)UpApiClient method implementing the categories listing logic by constructing the API endpoint with optional parent filter and calling makeRequest.async listCategories(filters?: { parentId?: string; }): Promise<{ data: CategoryResource[] }> { let endpoint = "/categories"; const params = new URLSearchParams(); if (filters?.parentId) { params.append("filter[parent]", filters.parentId); } if (params.toString()) { endpoint += `?${params.toString()}`; } return this.makeRequest(endpoint); }