List payment links
deonpay_list_linksRetrieve paginated payment links for your account, filterable by status, type, date range, and name search. Each link includes revenue stats.
Instructions
List payment links for the authenticated merchant. Use this when the user asks 'show me my payment links', 'what links did I create last week', or wants to find a link by name. Supports filtering by status (active/paused/expired/deleted), type (single/recurring/unlimited), free-text search across name/short_code/reference, and a date range. Returns a paginated list — each item includes id, short_code, name, amount in centavos, status, type, url, and aggregated stats (total_payments, successful_payments, total_revenue). Note: amounts are always in centavos (1 MXN = 100).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number (1-based). Defaults to 1. | |
| limit | No | Page size. Maximum 100, default 20. | |
| status | No | Filter by link status. | |
| type | No | Filter by link type. | |
| search | No | Free-text search across link name, short_code, or merchant_reference. | |
| date_from | No | Only links created on/after this date. | |
| date_to | No | Only links created on/before this date. |
Implementation Reference
- src/tools/links.ts:50-52 (handler)The handler function for the deonpay_list_links tool. Makes a GET request to /links with filtered/compact query params (page, limit, status, type, search, date_from, date_to). Wrapped in safeHandler for error handling.
safeHandler(async (args) => { return client.get("/links", compact(args)); }), - src/tools/links.ts:33-48 (schema)Input schema for deonpay_list_links: page, limit, status (active/paused/expired/deleted), type (single/recurring/unlimited), search (free-text), date_from, date_to. All optional. Uses Zod schemas from common.ts.
{ title: "List payment links", description: "List payment links for the authenticated merchant. Use this when the user asks 'show me my payment links', 'what links did I create last week', or wants to find a link by name. Supports filtering by status (active/paused/expired/deleted), type (single/recurring/unlimited), free-text search across name/short_code/reference, and a date range. Returns a paginated list — each item includes id, short_code, name, amount in centavos, status, type, url, and aggregated stats (total_payments, successful_payments, total_revenue). Note: amounts are always in centavos (1 MXN = 100).", inputSchema: { page: PageSchema.optional(), limit: LimitSchema.optional(), status: LinkStatusSchema.optional().describe("Filter by link status."), type: LinkTypeSchema.optional().describe("Filter by link type."), search: z .string() .optional() .describe("Free-text search across link name, short_code, or merchant_reference."), date_from: IsoDateStringSchema.optional().describe("Only links created on/after this date."), date_to: IsoDateStringSchema.optional().describe("Only links created on/before this date."), }, - src/tools/links.ts:27-53 (registration)Registration of the 'deonpay_list_links' tool via server.registerTool() inside registerLinkTools(). Also shows the wrapping registration function that registers all link tools.
export function registerLinkTools(server: McpServer, client: DeonpayClient): void { // ------------------------------------------------------------------------- // deonpay_list_links // ------------------------------------------------------------------------- server.registerTool( "deonpay_list_links", { title: "List payment links", description: "List payment links for the authenticated merchant. Use this when the user asks 'show me my payment links', 'what links did I create last week', or wants to find a link by name. Supports filtering by status (active/paused/expired/deleted), type (single/recurring/unlimited), free-text search across name/short_code/reference, and a date range. Returns a paginated list — each item includes id, short_code, name, amount in centavos, status, type, url, and aggregated stats (total_payments, successful_payments, total_revenue). Note: amounts are always in centavos (1 MXN = 100).", inputSchema: { page: PageSchema.optional(), limit: LimitSchema.optional(), status: LinkStatusSchema.optional().describe("Filter by link status."), type: LinkTypeSchema.optional().describe("Filter by link type."), search: z .string() .optional() .describe("Free-text search across link name, short_code, or merchant_reference."), date_from: IsoDateStringSchema.optional().describe("Only links created on/after this date."), date_to: IsoDateStringSchema.optional().describe("Only links created on/before this date."), }, }, safeHandler(async (args) => { return client.get("/links", compact(args)); }), ); - src/tools/_helpers.ts:57-68 (helper)The safeHandler helper that wraps the handler with try/catch, converting results to jsonResult and errors to errorResult.
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); } }; } - src/tools/_helpers.ts:83-90 (helper)The compact helper used by the handler to strip undefined/null/empty values from the args before sending to the API.
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>;