Skip to main content
Glama

hemmabo_booking_cancel

DestructiveIdempotent

Cancel a confirmed booking and process the Stripe refund per the host's cancellation policy. Idempotent to avoid duplicate refunds; requires the booking's guest token.

Instructions

Cancel a confirmed booking and process the Stripe refund per host cancellation policy. Use when the guest explicitly requests cancellation — if the guest wants new dates instead of ending the stay, use hemmabo_booking_reschedule instead. Do not use for pending/unpaid bookings — those expire automatically. To preview the applicable policy first, read cancellationPolicy from hemmabo_booking_status. Requires Authorization: Bearer token (MCP_API_KEY or OAuth); rate-limited per token. Destructive and idempotent in effect: a repeat cancel is refused as already cancelled and never triggers a second refund. reservationId is the booking UUID from hemmabo_booking_checkout or hemmabo_booking_create — never a propertyId — and must be paired with the guestToken issued for that same booking. reason is optional free text shown to the host; when omitted the host sees 'Cancelled via MCP'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reasonNoHuman-readable cancellation reason for the host (e.g. 'Travel plans changed', 'Flight cancelled'). Optional; omit when the guest did not give a reason.
guestTokenYesPer-booking secret returned by hemmabo_booking_create / hemmabo_booking_checkout (the booking's guest_token, a UUID). Required to view or modify this specific booking — a valid Bearer token alone is NOT sufficient, because it authenticates the caller but grants no authority over any particular booking. Present the exact guestToken you received when the booking was created; without the matching value the call is refused. Never a propertyId or reservationId.
reservationIdYesBooking or reservation UUID from hemmabo_booking_checkout or hemmabo_booking_create (e.g. '7c9e6679-7425-40de-944b-e07fc1f90ae7'). Required to look up, cancel, or reschedule the same booking record.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent only when isError=true.
refundNoRefund payload returned by cancel-booking edge function, when present.
statusYesFinal booking status after cancellation.
reservationIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv4.0.5
    • addedInput schema / properties / guestToken
      Added value: +{
      +  "description": "Per-booking secret returned by hemmabo_booking_create / hemmabo_booking_checkout (the booking's guest_token, a UUID). Required to view or modify this specific booking — a valid Bearer token alone is NOT sufficient, because it authenticates the caller but grants no authority over any particular booking. Present the exact guestToken you received when the booking was created; without the matching value the call is refused. Never a propertyId or reservationId.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "reservationId"
      -]New value: +[
      +  "reservationId",
      +  "guestToken"
      +]
  2. Changed4 schema fields changedv0.1.6
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / reservationId / pattern
      Removed value: -"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "error": {
      +      "description": "Present only when isError=true.",
      +      "type": "string"
      +    },
      +    "refund": {
      +      "additionalProperties": true,
      +      "description": "Refund payload returned by cancel-booking edge function, when present.",
      +      "type": "object"
      +    },
      +    "reservationId": {
      +      "format": "uuid",
      +      "type": "string"
      +    },
      +    "status": {
      +      "description": "Final booking status after cancellation.",
      +      "enum": [
      +        "cancelled"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "reservationId",
      +    "status"
      +  ],
      +  "type": "object"
      +}
  3. Changed4 schema fields changedv0.1.5
    • changedInput schema / properties / reason / description
      Previous value: -"Cancellation reason for host notification (e.g. 'Travel plans changed'). Optional but recommended."New value: +"Human-readable cancellation reason for the host (e.g. 'Travel plans changed', 'Flight cancelled'). Optional; omit when the guest did not give a reason."
    • changedInput schema / properties / reservationId / description
      Previous value: -"Booking or reservation UUID returned by hemmabo_booking_checkout or hemmabo_booking_create. Use this exact id for status, cancellation, or rescheduling."New value: +"Booking or reservation UUID from hemmabo_booking_checkout or hemmabo_booking_create (e.g. '7c9e6679-7425-40de-944b-e07fc1f90ae7'). Required to look up, cancel, or reschedule the same booking record."
    • addedInput schema / properties / reservationId / format
      Added value: +"uuid"
    • addedInput schema / properties / reservationId / pattern
      Added value: +"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
  4. Changed1 schema field changedv0.1.4
    • changedInput schema / properties / reservationId / description
      Previous value: -"Booking UUID from hemmabo_booking_checkout or hemmabo_booking_create (e.g. '550e8400-e29b-41d4-a716-446655440000')."New value: +"Booking or reservation UUID returned by hemmabo_booking_checkout or hemmabo_booking_create. Use this exact id for status, cancellation, or rescheduling."
  5. Changed1 schema field changedv0.1.3
    • changedInput schema / properties / reservationId / description
      Previous value: -"Booking UUID from booking.checkout or booking.create (e.g. '550e8400-e29b-41d4-a716-446655440000')."New value: +"Booking UUID from hemmabo_booking_checkout or hemmabo_booking_create (e.g. '550e8400-e29b-41d4-a716-446655440000')."
  6. Addedv0.1.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already signal destructive and idempotent, but the description goes further: repeat cancels are refused and never trigger a second refund, Stripe refunds follow the host policy, Bearer auth is required, and the call is rate-limited per token. No contradiction with annotations exists.

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 dense but well-organized: core action first, followed by exclusions, alternatives, prereqs, behavior, and parameter clarification. Every clause earns its place; the only minor cost is length, but that length is justified for a destructive financial tool.

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?

For a destructive, refund-triggering tool with auth constraints and token pairing, the description covers when to use it, prerequisites, behavioral idempotency, parameter provenance, and required credentials. The presence of an output schema means return-value documentation is not the description's burden; nothing needed for correct invocation is missing.

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, yet the description adds meaningful guidance beyond the schema: reservationId must be a booking UUID from specific sibling tools and never a propertyId, guestToken must match the exact token issued at creation and is not substitutable by a Bearer token, and an omitted reason shows 'Cancelled via MCP' to the host.

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 uses a specific verb-resource pair — 'Cancel a confirmed booking' — and adds the refund behavior. It also distinguishes itself from hemmabo_booking_reschedule by naming the condition that selects each tool, making sibling differentiation explicit.

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?

It gives explicit when-to-use ('guest explicitly requests cancellation'), when-not-to-use ('pending/unpaid bookings'), and a named alternative ('hemmabo_booking_reschedule'). It also provides a prerequisite step ('read cancellationPolicy from hemmabo_booking_status') and auth/rate-limit expectations, leaving nothing to inference.

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