Skip to main content
Glama

request_payment_link

Create payment links to request payments to your account via credit card or Solana tokens. Specify amount, recipient details, and customize payment pages for transactions.

Instructions

Create a payment link in order to request a payment to your account. This payment link can be used to pay you. Payment can be made using a credit card, or any Solana token (automatically converted to USDC)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
receivingPaymentNoEmail, phone or Solana wallet of the recipient of the payment
amountYesAmount to request
currencyNoCurrency of specified amount to requestUSD
titleNoA title for the payment shown to the payer
descriptionNoA description, shown in the payment page
returnOKURLNoOptional : URL to redirect the client to after successfull payment
returnURLNoOptional : URL to redirect the client to after failed payment
logoNoOptional : URL to an image displayed in payment page
paramNoCustom parameter
webhookNoHTTP webhook to call on payment success
notificationEmailNoEmail to notify on payment success

Implementation Reference

  • Core handler function implementing the request_payment_link tool: prepares request body, fetches user wallet if needed, calls /api/createPLink endpoint to generate payment link.
    export async function request_payment_link(reqBody: any) { if (reqBody.title) { reqBody.title = reqBody.title.split('\u20AC').join('euro'); } if (!reqBody.receivingPayment) { const { apiKey } = resolveAuth(undefined, undefined); var result = await getAPIuser(apiKey); if (result.pubk) reqBody.receivingPayment = result.pubk; if (result.error) { throw new Error(result.error); } } if (!reqBody.receivingPayment) { throw new Error('receivingPayment parameter required'); } var req = await fetch(BASE + '/api/createPLink', { method: 'POST', body: JSON.stringify(reqBody) }); var plink_Info = await req.json(); return plink_Info; }
  • Zod schema defining the input parameters for the request_payment_link tool (getCreatePLinkShape).
    export const getCreatePLinkShape = { receivingPayment: z.string().optional().describe("Email, phone or Solana wallet of the recipient of the payment"), amount: z.number().positive().describe("Amount to request"), currency: currencyZOD.describe("Currency of specified amount to request"), title: z.string().optional().describe("A title for the payment shown to the payer"), description: z.string().optional().describe("A description, shown in the payment page"), returnOKURL: z.string().optional().describe("Optional : URL to redirect the client to after successfull payment"), returnURL: z.string().optional().describe("Optional : URL to redirect the client to after failed payment"), logo: z.string().optional().describe("Optional : URL to an image displayed in payment page"), param: z.string().optional().describe("Custom parameter"), webhook: z.string().optional().describe("HTTP webhook to call on payment success"), notificationEmail: z.string().optional().describe("Email to notify on payment success") };
  • src/solution.ts:57-61 (registration)
    Tool definition registered in the tools list for ListToolsRequestSchema response.
    name: "request_payment_link", description: request_payment_link_title, inputSchema: jsonSchema(zodToJsonSchema(z.object(getCreatePLinkShape))).jsonSchema, annotations: { title: request_payment_link_title, readOnlyHint: true } },
  • Dispatch case in CallToolRequestSchema handler that invokes the request_payment_link function.
    case "request_payment_link": result = await request_payment_link(args); break;
  • Title string used in tool description and annotations.
    export const request_payment_link_title = "Create a payment link in order to request a payment to your account. This payment link can be used to pay you. Payment can be made using a credit card, or any Solana token (automatically converted to USDC)";

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/paracetamol951/P-Link-MCP'

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