Skip to main content
Glama
webimpianteam

Bayarcash MCP Server

list_transactions

Retrieve and filter payment transactions by status, payment channel, email, order number, or reference number to monitor and manage payment activities.

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

  • Core handler function that executes the API call to list 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);
      }
    }
  • MCP tool call handler for list_transactions, validates input and delegates to Bayarcash client.
    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 schema for validating input parameters to list_transactions tool.
    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)
    Tool registration in ListToolsRequestHandler, including 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'
          }
        }
      }
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions optional filters and a user interaction suggestion for payer_email, but fails to disclose critical behavioral traits such as whether this is a read-only operation, pagination behavior (implied by parameters but not explained), rate limits, authentication requirements, or what the return format looks like. For a list tool with 7 parameters and no annotation coverage, this is inadequate.

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 each serve a purpose: the first states the core functionality, and the second provides a specific usage tip. It's front-loaded with the main purpose, though the second sentence could be more directly integrated with the parameter guidance.

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, list operation with filtering and pagination), no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (transaction objects, arrays, metadata), how pagination works in practice, error conditions, or behavioral constraints. The description should provide more context for effective agent use.

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?

Schema description coverage is 100%, providing detailed documentation for all 7 parameters including enums and examples. The description adds minimal value beyond the schema by mentioning 'optional filters' and the payer_email interaction suggestion, but doesn't provide additional semantic context about parameter relationships or usage patterns. Baseline 3 is appropriate when the schema does the heavy lifting.

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 tool 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 implied usage guidance by mentioning a specific scenario involving 'payer_email from previous payment creation' and suggesting user interaction. However, it lacks explicit guidance on when to use this tool versus alternatives like 'get_transaction' or 'get_transaction_by_order,' and doesn't specify when-not-to-use cases or prerequisites.

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

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