Skip to main content
Glama
hectortemich

@deonpay/mcp-server

by hectortemich

List transactions for a payment link

deonpay_list_link_transactions

Lists all transactions for a payment link, showing customer info, payment details, and status, to inspect who paid and amounts collected.

Instructions

List all transactions associated with a specific payment link. Use this when the user asks 'who paid for this link', 'how much did link X collect', or wants to inspect failed attempts on a single link. Returns paginated transactions with customer info, card brand/last_four, amount in centavos and status. The link can be referenced by UUID or short_code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesLink UUID or short_code.
pageNoPage number (1-based). Defaults to 1.
limitNoPage size. Maximum 100, default 20.

Implementation Reference

  • The registerAllTools function orchestrates registration of all tool modules, including registerLinkTools which registers deonpay_list_link_transactions.
    export function registerAllTools(server: McpServer, client: DeonpayClient): void {
      registerLinkTools(server, client);
      registerCheckoutTools(server, client);
      registerTransactionTools(server, client);
      registerProductTools(server, client);
      registerSubscriptionTools(server, client);
      registerCustomerSubscriptionTools(server, client);
      registerCustomerTools(server, client);
      registerMetricsTools(server, client);
    }
  • src/server.ts:14-35 (registration)
    createServer builds the McpServer and calls registerAllTools to register all tools including the link transactions tool.
    export function createServer(config: Config): McpServer {
      const server = new McpServer(
        {
          name: "deonpay-mcp-server",
          version: config.version,
        },
        {
          capabilities: {
            tools: {},
          },
          instructions:
            "DeonPay MCP server. Use these tools to query payments, payment links, " +
            "subscriptions, customers and metrics for the authenticated merchant. " +
            "All amounts are in CENTAVOS (1 MXN = 100). Reads are safe; the writes " +
            "available in this build (create_link, create_checkout_session, " +
            "create_product, create_subscription, update_link, update_product) are " +
            "non-destructive — refunds, cancellations and deletions are not exposed.",
        },
      );
    
      const client = new DeonpayClient(config);
      registerAllTools(server, client);
  • The deonpay_list_link_transactions tool registration. It is registered on the McpServer with input schema (id, page, limit). The handler calls client.get('/links/{id}/transactions') with compacted pagination params.
    server.registerTool(
      "deonpay_list_link_transactions",
      {
        title: "List transactions for a payment link",
        description:
          "List all transactions associated with a specific payment link. Use this when the user asks 'who paid for this link', 'how much did link X collect', or wants to inspect failed attempts on a single link. Returns paginated transactions with customer info, card brand/last_four, amount in centavos and status. The link can be referenced by UUID or short_code.",
        inputSchema: {
          id: z.string().min(1).describe("Link UUID or short_code."),
          page: PageSchema.optional(),
          limit: LimitSchema.optional(),
        },
      },
      safeHandler(async ({ id, page, limit }) => {
        return client.get(`/links/${encodeURIComponent(id)}/transactions`, compact({ page, limit }));
      }),
    );
  • PageSchema and LimitSchema define the reusable pagination input types used by deonpay_list_link_transactions.
    export const PageSchema = z
      .number()
      .int()
      .min(1)
      .default(1)
      .describe("Page number (1-based). Defaults to 1.");
  • safeHandler wraps the tool's async handler with try/catch, converting thrown errors to MCP-shaped error results. The compact helper strips undefined/null/empty values from the args before passing to the API.
    export function safeHandler<TArgs>(
      fn: (args: TArgs) => Promise<unknown>,
    ): (args: TArgs) => Promise<CallToolResult> {
      return async (args: TArgs) => {
        try {
          const value = await fn(args);
          return jsonResult(value);
        } catch (err) {
          return errorResult(err);
        }
      };
    }
    
    /**
     * Encodes the local part / full email for use in path segments. RFC 3986 says
     * `@` is reserved as a sub-delim, so encodeURIComponent is the safe choice.
     */
    export function encodePathSegment(value: string): string {
      return encodeURIComponent(value);
    }
    
    /**
     * Strips undefined / null / empty-string entries from a body before sending.
     * The DeonPay API accepts missing fields cleanly but treating "" as a valid
     * value would override server-side defaults — usually not what the LLM means.
     */
    export function compact<T extends Record<string, unknown>>(obj: T): Partial<T> {
      const out: Record<string, unknown> = {};
      for (const [key, value] of Object.entries(obj)) {
        if (value === undefined || value === null) continue;
        if (typeof value === "string" && value.trim() === "") continue;
        out[key] = value;
      }
      return out as Partial<T>;
    }
Behavior4/5

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

No annotations are provided, so the description must carry the full burden. It discloses that the tool returns paginated transactions with customer info, card brand/last_four, amount in centavos, status, and that the link can be referenced by UUID or short_code. It implies read-only behavior and does not contradict any annotations.

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 four sentences long, all relevant and front-loaded with the core purpose. It is efficient but could be slightly more streamlined without losing clarity.

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

Completeness4/5

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

Given no output schema, the description covers the key return fields (customer info, card, amount, status) and pagination behavior. It is complete enough for an agent to understand what to expect, though it does not detail the exact schema of the response.

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 coverage is 100%, so baseline is 3. The description adds that the 'id' parameter can be a UUID or short_code (matching schema) and mentions paginated results, but does not add significant meaning beyond the schema descriptions for page and limit. The baseline of 3 is appropriate.

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 all transactions associated with a specific payment link' and provides concrete example queries like 'who paid for this link' and 'how much did link X collect'. It distinguishes itself from siblings such as deonpay_list_transactions (general list) and deonpay_get_transaction (single transaction).

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

Usage Guidelines4/5

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

The description explicitly tells when to use this tool ('when the user asks who paid for this link...') and implicitly excludes use cases for listing all transactions or getting a single transaction. However, it does not explicitly mention when not to use it or list alternatives, but the context is clear.

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/hectortemich/deonpay-mcp-server'

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