get_categories
Retrieve categories for a specific wallet in the Money Lover app to organize and manage financial transactions effectively.
Instructions
Retrieve categories for a specific wallet.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | No | JWT token returned by the login tool or derived from EMAIL/PASSWORD environment variables | |
| walletId | Yes | Wallet identifier |
Implementation Reference
- src/moneyloverClient.js:126-133 (handler)Core handler function in MoneyloverClient that performs the API POST request to fetch categories for a given wallet ID.async getCategories(walletId) { const form = new URLSearchParams(); form.set('walletId', ensureString(walletId, 'walletId')); return this.#post('/category/list', { body: form.toString(), headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }); }
- src/server.js:365-371 (schema)Input and output schema definitions for the get_categories tool using Zod, including optional token and required walletId.inputSchema: { ...tokenArgument, walletId: z.string().min(1).describe('Wallet identifier') }, outputSchema: { categories: z.array(z.record(z.any())) }
- src/server.js:360-381 (registration)MCP tool registration call for 'get_categories', including schema definitions, description, and wrapper handler that delegates to MoneyloverClient.getCategories after token resolution.server.registerTool( 'get_categories', { title: 'Get Categories', description: 'Retrieve categories for a specific wallet.', inputSchema: { ...tokenArgument, walletId: z.string().min(1).describe('Wallet identifier') }, outputSchema: { categories: z.array(z.record(z.any())) } }, async ({ token, walletId }) => { try { const data = (await runWithClient(token, client => client.getCategories(walletId))) ?? []; return formatSuccess({ categories: data }); } catch (error) { return formatError(error instanceof Error ? error : new Error(String(error))); } } );