Skip to main content
Glama

invalidate_payment_link_if_pending

Destructive

Cancel a payment link only if it's still pending; otherwise do nothing. Use to retire abandoned checkouts or withdraw mispriced links safely, without affecting already-paid orders.

Instructions

Cancel a payment link only if it is still pending; otherwise do nothing.

Use this to retire a checkout the buyer abandoned, or to withdraw a link you priced
wrong before anyone pays it. It is the safe version of `invalidate_payment_link`,
which cancels without checking status first.

A success response does NOT mean the link was cancelled — Wayl also answers with
success when the link was not pending and nothing happened. Do not report the order
as cancelled on the strength of this call alone; confirm with `get_payment_link`.

Cancellation is irreversible: nobody can pay through that URL afterwards and you
would have to issue a new link with a fresh reference ID. This never moves money —
to return money on an order that was already paid, use `create_refund`.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reference_idYesReference ID of the link to cancel.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Even though annotations already flag this as destructive, the description adds crucial behavioral nuances: success does not imply cancellation (the tool no-ops on non-pending links), cancellation is irreversible, and it never moves money. It also advises confirming with `get_payment_link`, which is high-value context beyond the 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 somewhat verbose (four paragraphs) but every sentence carries meaningful information: purpose, use cases, a critical caveat about success responses, and irreversible consequences. It is front-loaded with the main purpose and structured logically. Slightly dense but earns its length.

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?

The description covers purpose, conditional behavior, alternatives, side effects, and verification steps. With an output schema present, it doesn't need to detail return values. This is a complete and self-contained guide for a destructive, conditional operation.

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?

The schema has 100% coverage for the single parameter `reference_id` with a clear description. The tool description doesn't add much parameter-specific detail beyond what the schema already says, but it does reference 'fresh reference ID' when mentioning issuing new links, which is indirect. Baseline 3 is appropriate given full schema coverage.

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 a precise, conditional statement: 'Cancel a payment link only if it is still pending; otherwise do nothing.' This clearly identifies the verb (cancel/invalidate), resource (payment link), and the unique condition (pending). It also distinguishes itself from the sibling tool `invalidate_payment_link` by calling itself the 'safe version' that checks status first.

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?

The description gives explicit use cases: retiring abandoned checkouts or withdrawing incorrectly priced links. It also contrasts with `invalidate_payment_link` (the non-conditional version) and directs users to `create_refund` for returning money, making when-to-use and alternatives very 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/muthanii/waylMCP'

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