Skip to main content
Glama

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' } } } },

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