Skip to main content
Glama

create_payment_link

Generate a payment link to receive a checkout URL for charging buyers in IQD. Supports live/test mode, line items, and webhooks.

Instructions

Create a Wayl payment link and return the checkout URL to send the buyer.

This is the general-purpose builder. For selling a book, `sell_book` is usually less
work — it derives the line items and reference ID for you.

The returned `url` is the hosted checkout page. Nothing is charged until the buyer
completes payment there; poll `check_order_paid` or handle the webhook to learn when
that happens. env='live' takes the buyer's real money; env='test' charges nobody.

`reference_id` must be unique across every link you have ever created; omit it and
one is generated. Passing `webhook_url` without `webhook_secret` is refused — an
unsigned notification cannot be authenticated.

Record the response's `code` and any `webhook_secret` you pass: neither is returned
by any other Wayl endpoint, and no read endpoint reports a link's `env` either. This
call is never retried and Wayl has no idempotency key, so after a timeout check
`get_payment_link` before creating a second link.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
envNo'live' takes real money, 'test' is a sandbox that charges nobody. Defaults to 'test'.
totalYesAmount to charge in whole IQD. Minimum 1000.
currencyNoCurrency code. Wayl settles in IQD only.IQD
line_itemsNoOptional cost breakdown shown at checkout. The amounts must reconcile to `total` — increases minus decreases, or the plain sum of every amount; Wayl does not document which, so either is accepted.
webhook_urlNoURL Wayl POSTs to when the payment status changes.
reference_idNoYour unique order ID. Must never repeat across your links. Omit to have one generated.
webhook_secretNoShared secret used to sign webhooks, so you can prove a notification really came from Wayl.
redirection_urlNoWhere to send the buyer after paying. Wayl appends referenceId and orderid as query parameters.
custom_parameterNoFree-form string echoed back to you, for your own tracking.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Beyond the annotations (readOnlyHint=false, openWorldHint=true), the description reveals crucial behaviors: 'Nothing is charged until the buyer completes payment there,' env='test' charges nobody, uniqueness requirements for reference_id, refusal of unsigned webhooks, and the fact that `code` and `webhook_secret` are not retrievable later. It also notes the call is never retried and has no idempotency key, providing comprehensive operational transparency.

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

Conciseness5/5

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

The description is concise yet information-dense, with each sentence serving a distinct purpose: purpose, alternative, charge behavior, reference_id uniqueness, webhook constraint, data irrecoverability, and idempotency warning. It is front-loaded with the primary action and avoids redundant phrasing.

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

Completeness5/5

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

Given the tool's complexity (9 parameters, output schema, annotations), the description covers all critical operational aspects: return value semantics, environmental differences, webhook security pairing, uniqueness constraints, data persistence caveats, and retry behavior. It leaves no major gaps that would cause an agent to misuse the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds significant value by explaining parameter interdependencies (e.g., 'Passing `webhook_url` without `webhook_secret` is refused'), uniqueness requirements, and the ambiguity in line_items reconciliation. It also clarifies the meaning of env values and the irrecoverability of `code` and `webhook_secret`, enriching the schema's bare definitions.

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 opens with 'Create a Wayl payment link and return the checkout URL to send the buyer,' a specific verb+resource statement that clearly distinguishes this from siblings like `sell_book` and `get_payment_link`. It further clarifies that this is the 'general-purpose builder,' reinforcing its role.

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

Usage Guidelines5/5

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

Explicitly contrasts with the sibling tool: 'For selling a book, `sell_book` is usually less work — it derives the line items and reference ID for you.' It also explains when to poll `check_order_paid` and warns about the env distinction, giving clear context for when to use this tool vs alternatives.

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/muthanii/waylMCP'

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