Skip to main content
Glama

Cancel Paid Booking

cancel_booking
DestructiveIdempotent

Cancels a paid, confirmed booking using the cancel_token from its payment receipt. Within 60 minutes of paying, or before the business's refund window, the full refund is requested; report it as full only after the payment ledger confirms it. After that window the deposit is forfeited under the booking's policy. A pending refund means cancellation is complete while refund verification or retry continues. Only the agent that paid holds the token. Cancelling twice answers already_cancelled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYesBusiness slug identifier
cancel_tokenYesThe cancel_token from the payment receipt
reservation_idYesThe paid reservation's id

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
refundYesfull: the payment ledger confirms the refund; none: deposit was forfeited; pending: cancellation is complete and refund verification or retry is pending
statusYes
currencyYes
pending_centsYes
refunded_centsYes
reservation_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedOutput schema / properties / pending_cents
      Added value: +{
      +  "maximum": 9007199254740991,
      +  "minimum": -9007199254740991,
      +  "type": "integer"
      +}
    • changedOutput schema / properties / refund / description
      Previous value: -"full: refunded to the payment method; none: the deposit was forfeited under the policy"New value: +"full: the payment ledger confirms the refund; none: deposit was forfeited; pending: cancellation is complete and refund verification or retry is pending"
    • changedOutput schema / properties / refund / enum
      Previous value: -[
      -  "full",
      -  "none"
      -]New value: +[
      +  "full",
      +  "none",
      +  "pending"
      +]
    • changedOutput schema / required
      Previous value: -[
      -  "status",
      -  "reservation_id",
      -  "refund",
      -  "refunded_cents",
      -  "currency"
      -]New value: +[
      +  "status",
      +  "reservation_id",
      +  "refund",
      +  "refunded_cents",
      +  "pending_cents",
      +  "currency"
      +]
  2. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=true, and idempotentHint=true. The description adds valuable context beyond these: the refund window logic, the distinction between full refund and forfeited deposit, the meaning of 'pending refund', and the already_cancelled response for duplicate calls. It doesn't contradict the annotations. The only minor gap is that it doesn't explicitly state what happens to the booking record itself (e.g., whether it's deleted or marked cancelled), but the destructiveHint and the refund discussion cover the key behavioral traits.

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 a single dense paragraph that front-loads the core action and token requirement, then explains refund behavior and edge cases. Every sentence adds meaningful information. It's slightly long but justified given the complexity of refund logic. The structure is logical: action → refund timing → pending state → token ownership → duplicate behavior.

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?

The description covers the essential behavioral context: what constitutes a full refund, when deposit is forfeited, what pending refund means, token ownership, and duplicate handling. The output schema exists, so return values don't need to be described. The only minor gap is that it doesn't explicitly mention prerequisites like having a payment receipt or the business's refund policy details, but the description references the policy and the token requirement sufficiently.

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 description coverage is 100%, so the schema already documents all three parameters (slug, reservation_id, cancel_token). The description adds the crucial semantic link that cancel_token comes from the payment receipt and that reservation_id is for the paid reservation, but it doesn't go beyond what the schema already states. Baseline 3 is appropriate since the schema does the heavy lifting.

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 states a specific verb ('Cancels'), a specific resource ('a paid, confirmed booking'), and the key mechanism ('using the cancel_token from its payment receipt'). It clearly distinguishes this from siblings like confirm_booking and create_booking_payment_link by focusing on the cancellation action and its token requirement.

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 provides explicit context for when to use the tool: for paid, confirmed bookings with a cancel_token. It also gives clear behavioral guidance on refund timing ('Within 60 minutes of paying, or before the business's refund window'), how to report refund status ('report it as full only after the payment ledger confirms it'), and what to do about pending refunds. It even addresses the edge case of double cancellation ('Cancelling twice answers already_cancelled'). This is strong usage guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.