Skip to main content
Glama

list_transactions

Retrieve a list of transactions with optional filters for customer, invoice, status, type, date range, gateway, and pagination.

Instructions

List transactions. GET /transactions. Optional: customerId, invoiceId, status (settled|authorized|declined|error|voided|requiresPaymentMethod|awaitingForSettlement|authorizeAndHold), type (sale|refund), dateFrom, dateTo, companyGatewayId, orderBy, sortBy, itemPerPage, pageNo.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customerIdNoFilter by customer ID
invoiceIdNoFilter by invoice ID
statusNoFilter by transaction status
typeNoFilter by transaction type
dateFromNoFilter by date from (YYYY-MM-DD)
dateToNoFilter by date to (YYYY-MM-DD)
companyGatewayIdNoFilter by company gateway ID
orderByNoSort column
sortByNoSort direction
itemPerPageNoItems per page
pageNoNoPage number

Implementation Reference

  • Handler function for list_transactions. Parses args with Zod schema, then calls transactionService.listTransactions.
    async function handler(client: Client, args: Record<string, unknown> | undefined) {
      const parsed = schema.safeParse(args);
      if (!parsed.success) {
        return errorResult(parsed.error.errors.map((e) => e.message).join("; "));
      }
      return handleToolCall(() => transactionService.listTransactions(client, parsed.data));
    }
  • Zod input validation schema for list_transactions tool parameters.
    const schema = z.object({
      customerId: z.number().int().optional(),
      invoiceId: z.number().int().optional(),
      status: z
        .enum([
          "settled",
          "authorized",
          "declined",
          "error",
          "voided",
          "requiresPaymentMethod",
          "awaitingForSettlement",
          "authorizeAndHold",
        ])
        .optional(),
      type: z.enum(["sale", "refund"]).optional(),
      dateFrom: z.string().optional(),
      dateTo: z.string().optional(),
      companyGatewayId: z.number().int().optional(),
      orderBy: z.string().optional(),
      sortBy: z.string().optional(),
      itemPerPage: z.number().int().min(1).optional(),
      pageNo: z.number().int().min(1).optional(),
    });
  • Registration of listTransactionsTool as part of the transaction tools array.
    /**
     * Transaction tools: list, get, refund, void.
     */
    
    import type { Tool } from "../types.js";
    import { getTransactionTool } from "./getTransaction.js";
    import { listTransactionsTool } from "./listTransactions.js";
    import { refundTransactionTool } from "./refundTransaction.js";
    import { voidTransactionTool } from "./voidTransaction.js";
    
    /** All 4 transaction tools. */
    export function registerTransactionTools(): Tool[] {
      return [
        listTransactionsTool,
        getTransactionTool,
        refundTransactionTool,
        voidTransactionTool,
      ];
    }
    
    export { listTransactionsTool } from "./listTransactions.js";
    export { getTransactionTool } from "./getTransaction.js";
    export { refundTransactionTool } from "./refundTransaction.js";
    export { voidTransactionTool } from "./voidTransaction.js";
  • Service function that makes the actual HTTP GET /transactions API call with query parameters.
    export async function listTransactions(
      client: Client,
      params?: ListTransactionsParams
    ): Promise<PaginatedResponse<unknown>> {
      const search = new URLSearchParams();
      if (params?.customerId != null) search.append("customerId", String(params.customerId));
      if (params?.invoiceId != null) search.append("invoiceId", String(params.invoiceId));
      if (params?.status) search.append("status", params.status);
      if (params?.type) search.append("type", params.type);
      if (params?.dateFrom) search.append("dateFrom", params.dateFrom);
      if (params?.dateTo) search.append("dateTo", params.dateTo);
      if (params?.companyGatewayId != null) {
        search.append("companyGatewayId", String(params.companyGatewayId));
      }
      if (params?.orderBy) search.append("orderBy", params.orderBy);
      if (params?.sortBy) search.append("sortBy", params.sortBy);
      if (params?.itemPerPage != null) search.append("itemPerPage", String(params.itemPerPage));
      if (params?.pageNo != null) search.append("pageNo", String(params.pageNo));
      const q = search.toString();
      return client.get<PaginatedResponse<unknown>>(`/transactions${q ? `?${q}` : ""}`);
  • TypeScript interface for the listTransactions API parameters.
    export interface ListTransactionsParams {
      customerId?: number;
      invoiceId?: number;
      status?:
        | "settled"
        | "authorized"
        | "declined"
        | "error"
        | "voided"
        | "requiresPaymentMethod"
        | "awaitingForSettlement"
        | "authorizeAndHold";
      type?: "sale" | "refund";
      dateFrom?: string;
      dateTo?: string;
      companyGatewayId?: number;
      orderBy?: string;
      sortBy?: string;
      itemPerPage?: number;
      pageNo?: number;
    }
Behavior2/5

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

With no annotations, the description should disclose behavioral traits. It only states 'List transactions' and lists parameters, omitting details like read-only nature, pagination behavior, or required permissions. The description does not convey that this is a read operation.

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

Conciseness3/5

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

The description is concise as a single sentence, but it includes the HTTP endpoint which may be redundant. It lacks structure and could be more readable with bullet points or sections for parameters.

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 11 optional parameters and no output schema, the description should explain what the tool returns (a list of transactions, paginated). It fails to describe the output structure, making it incomplete for the agent to understand the full behavior.

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%, so the baseline is 3. The description repeats parameter names and enum values from the schema without adding new meaning, such as expected format for dateFrom/dateTo or the effect of orderBy and sortBy.

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

Purpose5/5

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

The description clearly states 'List transactions' with a verb and resource, and includes the HTTP endpoint and optional filters, distinguishing it from sibling tools like get_transaction or list_invoices.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives such as get_transaction for a single transaction or other list tools. It only lists parameters without context for selection.

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/rhinosaas/rebillia-mcp-server'

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