get_transactions
Fetch wallet transactions within a specified date range to track spending, monitor income, and analyze financial activity over time.
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 function that executes the get_transactions logic: resolves token, invokes MoneyloverClient.getTransactions, and returns formatted success or error response.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-399 (schema)Input schema definition for the get_transactions tool, specifying parameters: token (optional), walletId, startDate, and endDate with 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)Registration of the 'get_transactions' MCP tool on the server, providing title, description, input schema, and handler function.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 performs the actual API POST request to /transaction/list with walletId, startDate, and endDate.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' } }); }