Skip to main content
Glama

list_transactions

Retrieve and filter payment transactions by status, channel, email, or reference numbers to monitor payment activity and track financial records.

Instructions

List all transactions with optional filters. If you have payer_email from previous payment creation, ask user: "Filter by email from last payment: {email}?"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNoFilter by transaction status code (integer). Status codes: 0=New, 1=Pending, 2=Failed, 3=Success, 4=Cancelled. Example: Use 3 for successful transactions, not "success".
payment_channelNoFilter by payment channel ID (number, not string). Use channel IDs: 1=FPX, 2=DuitNow, 3=Boost, 4=GrabPay, 5=TNG, 6=ShopeePay, 7=SPayLater, 8=BoostPayFlex, 9=QRIS, 10=NETS. Example: For FPX payments use 1, not "fpx".
payer_emailNoFilter by payer email. If you stored email from previous create_payment_intent, ask user if they want to filter by it.
order_numberNoFilter by order number
reference_numberNoFilter by reference number
pageNoPage number for pagination
per_pageNoNumber of items per page

Implementation Reference

  • MCP tool handler for 'list_transactions': validates input using listTransactionsSchema and delegates to BayarcashClient.getAllTransactions, returning JSON response.
    case 'list_transactions': {
      // Validate input
      const validation = validateInput(listTransactionsSchema, args);
      if (!validation.success) {
        throw new McpError(ErrorCode.InvalidParams, `Validation error: ${validation.error}`);
      }
    
      const result = await bayarcash.getAllTransactions(validation.data);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }
        ]
      };
    }
  • Zod input schema for list_transactions tool defining optional filters for status, payment_channel, payer_email, etc.
    export const listTransactionsSchema = z.object({
      status: statusCodeSchema.optional(),
      payment_channel: paymentChannelSchema.optional(),
      payer_email: emailSchema.optional(),
      order_number: z.string().optional(),
      reference_number: z.string().optional(),
      page: z.number().int().positive().optional(),
      per_page: z.number().int().positive().max(100).optional()
    });
  • src/index.ts:144-180 (registration)
    Registration of 'list_transactions' tool in ListTools handler, specifying name, description, and input schema.
    {
      name: 'list_transactions',
      description: 'List all transactions with optional filters. If you have payer_email from previous payment creation, ask user: "Filter by email from last payment: {email}?"',
      inputSchema: {
        type: 'object',
        properties: {
          status: {
            type: 'number',
            description: 'Filter by transaction status code (integer). Status codes: 0=New, 1=Pending, 2=Failed, 3=Success, 4=Cancelled. Example: Use 3 for successful transactions, not "success".'
          },
          payment_channel: {
            type: 'number',
            description: 'Filter by payment channel ID (number, not string). Use channel IDs: 1=FPX, 2=DuitNow, 3=Boost, 4=GrabPay, 5=TNG, 6=ShopeePay, 7=SPayLater, 8=BoostPayFlex, 9=QRIS, 10=NETS. Example: For FPX payments use 1, not "fpx".'
          },
          payer_email: {
            type: 'string',
            description: 'Filter by payer email. If you stored email from previous create_payment_intent, ask user if they want to filter by it.'
          },
          order_number: {
            type: 'string',
            description: 'Filter by order number'
          },
          reference_number: {
            type: 'string',
            description: 'Filter by reference number'
          },
          page: {
            type: 'number',
            description: 'Page number for pagination'
          },
          per_page: {
            type: 'number',
            description: 'Number of items per page'
          }
        }
      }
    },
  • BayarcashClient helper method implementing the core logic for listing transactions via API GET /transactions with optional filters and pagination.
    async getAllTransactions(filters?: {
      status?: number;
      payment_channel?: number;
      payer_email?: string;
      order_number?: string;
      exchange_reference_number?: string;
      page?: number;
      per_page?: number;
    }): Promise<TransactionsResponse> {
      try {
        const response = await this.axiosInstance.get('/transactions', { params: filters });
        return response.data;
      } catch (error) {
        this.handleError(error);
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions filtering and pagination parameters, it doesn't describe important behavioral traits like whether this is a read-only operation, what authentication is required, rate limits, error conditions, or what the return format looks like (especially critical since there's no output schema).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with two sentences that both serve clear purposes. The first sentence states the core functionality, and the second provides specific workflow guidance. There's no wasted text, though it could be slightly more front-loaded with the most critical information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (7 parameters, no annotations, no output schema), the description is insufficiently complete. It doesn't explain what the tool returns, how pagination works in practice, error handling, or authentication requirements. For a list/query tool with rich filtering options, users need more context about the response format and behavioral expectations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly with examples and enum mappings. The description adds minimal value beyond the schema - it only mentions 'optional filters' and references payer_email filtering in a workflow context, which doesn't significantly enhance understanding of parameter semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'List all transactions with optional filters', which is a specific verb+resource combination. However, it doesn't explicitly differentiate this from sibling tools like 'get_transaction' or 'get_transaction_by_order', which appear to retrieve individual transactions rather than lists.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some implied usage guidance by mentioning 'If you have payer_email from previous payment creation, ask user...', which suggests a workflow connection to 'create_payment_intent'. However, it doesn't explicitly state when to use this tool versus alternatives like 'get_transaction' or provide clear exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/khairulimran-97/bayarcash-mcp-server'

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