rezdy_agent_cancel_booking
Cancel travel bookings by ID through Rezdy Agent API. Process customer cancellations with optional reason specification for travel agents managing reservations.
Instructions
Cancel an existing booking
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"bookingId": "<bookingId>"
},
"name": "rezdy_agent_cancel_booking"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bookingId | Yes | Booking ID | |
| reason | No | Cancellation reason |
Implementation Reference
- src/index.ts:650-663 (handler)Handler function that executes the rezdy_agent_cancel_booking tool logic. Validates client is configured, extracts bookingId and reason from args, calls the client's cancelBooking method, and returns the response as JSON.
private async handleCancelBooking(args: any) { const client = this.ensureClient(); const { bookingId, reason } = args; const response = await client.cancelBooking(bookingId, reason); return { content: [ { type: 'text', text: JSON.stringify(response, null, 2), }, ], }; } - src/agent-client.ts:185-195 (helper)Underlying cancelBooking method in RezdyAgentClient that makes the actual API call to cancel a booking. Sends POST request to /marketplace/bookings/{bookingId}/cancel endpoint with optional cancellation reason in request body.
async cancelBooking(bookingId: string, reason?: string): Promise<RezdyApiResponse> { const requestOptions: RequestInit = { method: 'POST', }; if (reason) { requestOptions.body = JSON.stringify({ reason }); } return this.makeRequest(`/marketplace/bookings/${bookingId}/cancel`, requestOptions); } - src/index.ts:341-352 (registration)Tool registration block defining the rezdy_agent_cancel_booking tool schema. Includes tool name, description, and input schema with bookingId (required) and reason (optional) properties.
{ name: 'rezdy_agent_cancel_booking', description: 'Cancel an existing booking', inputSchema: { type: 'object', properties: { bookingId: { type: 'string', description: 'Booking ID' }, reason: { type: 'string', description: 'Cancellation reason' }, }, required: ['bookingId'], }, }, - src/index.ts:458-459 (registration)Case statement in the tool dispatcher switch block that routes rezdy_agent_cancel_booking calls to the handleCancelBooking method.
case 'rezdy_agent_cancel_booking': return await this.handleCancelBooking(args);