get_transactions
Fetch wallet transactions within a specified date range to track expenses and analyze financial activity.
Instructions
Fetch transactions for a wallet between two dates.
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 | |
| startDate | Yes | Start date in YYYY-MM-DD format | |
| endDate | Yes | End date in YYYY-MM-DD format |
Implementation Reference
- src/server.js:401-408 (handler)MCP tool handler for 'get_transactions'. Runs the client method via runWithClient and handles response/error formatting.async ({ token, walletId, startDate, endDate }) => { try { const data = await runWithClient(token, client => client.getTransactions(walletId, startDate, endDate)); return formatSuccess(data ?? {}); } catch (error) { return formatError(error instanceof Error ? error : new Error(String(error))); } }
- src/server.js:388-398 (schema)Input schema definition using Zod for token, walletId, startDate, and endDate validation.inputSchema: { ...tokenArgument, walletId: z.string().min(1).describe('Wallet identifier'), startDate: z .string() .regex(/\d{4}-\d{2}-\d{2}/) .describe('Start date in YYYY-MM-DD format'), endDate: z .string() .regex(/\d{4}-\d{2}-\d{2}/) .describe('End date in YYYY-MM-DD format')
- src/server.js:383-409 (registration)Registers the 'get_transactions' tool with McpServer, providing title, description, schema, and handler.server.registerTool( 'get_transactions', { title: 'Get Transactions', description: 'Fetch transactions for a wallet between two dates.', inputSchema: { ...tokenArgument, walletId: z.string().min(1).describe('Wallet identifier'), startDate: z .string() .regex(/\d{4}-\d{2}-\d{2}/) .describe('Start date in YYYY-MM-DD format'), endDate: z .string() .regex(/\d{4}-\d{2}-\d{2}/) .describe('End date in YYYY-MM-DD format') } }, async ({ token, walletId, startDate, endDate }) => { try { const data = await runWithClient(token, client => client.getTransactions(walletId, startDate, endDate)); return formatSuccess(data ?? {}); } catch (error) { return formatError(error instanceof Error ? error : new Error(String(error))); } } );
- src/moneyloverClient.js:135-145 (helper)MoneyloverClient helper method that makes API POST request to /transaction/list to fetch transactions.async getTransactions(walletId, startDate, endDate) { const payload = { walletId: ensureString(walletId, 'walletId'), startDate: ensureString(startDate, 'startDate'), endDate: ensureString(endDate, 'endDate') }; return this.#post('/transaction/list', { body: JSON.stringify(payload), headers: { 'Content-Type': 'application/json' } }); }