Skip to main content
Glama
ferdhika31

Money Lover MCP Server

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
NameRequiredDescriptionDefault
tokenNoJWT token returned by the login tool or derived from EMAIL/PASSWORD environment variables
walletIdYesWallet identifier
startDateYesStart date in YYYY-MM-DD format
endDateYesEnd date in YYYY-MM-DD format

Implementation Reference

  • 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)));
      }
    }
  • 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)));
        }
      }
    );
  • 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' }
      });
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ferdhika31/moneylover-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server