calcom_delete_appointment
Cancel appointments in Cal.com by deleting them using the booking ID. This tool removes scheduled events from your calendar.
Instructions
Deletes an existing appointment from Cal.com calendar. Use this for canceling appointments. Requires booking ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bookingId | Yes | The Cal.com booking ID to delete | |
| reason | No | Optional reason for cancellation |
Implementation Reference
- index.ts:326-342 (handler)Core handler function that executes the deletion logic by calling the Cal.com API DELETE /bookings/{bookingId} endpoint, handles rate limiting, errors, and formats the response.async function deleteAppointment(bookingId: number, reason?: string) { checkRateLimit(); try { await calComApiClient.delete(`/bookings/${bookingId}`, { data: reason ? { reason } : undefined }); return `Appointment deleted successfully! Booking ID: ${bookingId} ${reason ? `Reason: ${reason}` : ""}`; } catch (error: any) { if (axios.isAxiosError(error)) { throw new Error(`Failed to delete appointment: ${error.response?.data?.message || error.message}`); } throw new Error(`Failed to delete appointment: ${String(error)}`); } }
- index.ts:421-431 (handler)Tool call dispatcher in CallToolRequestSchema handler that validates arguments and invokes the deleteAppointment function.case "calcom_delete_appointment": { if (!isCalComDeleteAppointmentArgs(args)) { throw new Error("Invalid arguments for calcom_delete_appointment"); } const { bookingId, reason } = args; const result = await deleteAppointment(bookingId, reason); return { content: [{ type: "text", text: result }], isError: false, }; }
- index.ts:236-245 (schema)Type guard function for validating input arguments to the calcom_delete_appointment tool.function isCalComDeleteAppointmentArgs(args: unknown): args is { bookingId: number; reason?: string; } { return ( typeof args === "object" && args !== null && "bookingId" in args ); }
- index.ts:80-100 (registration)Tool definition object including name, description, and input schema, used for registration.const DELETE_APPOINTMENT_TOOL: Tool = { name: "calcom_delete_appointment", description: "Deletes an existing appointment from Cal.com calendar. " + "Use this for canceling appointments. " + "Requires booking ID. ", inputSchema: { type: "object", properties: { bookingId: { type: "number", description: "The Cal.com booking ID to delete" }, reason: { type: "string", description: "Optional reason for cancellation" } }, required: ["bookingId"], } };
- index.ts:379-386 (registration)Registration of all tools including calcom_delete_appointment in the ListToolsRequestSchema handler.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ ADD_APPOINTMENT_TOOL, UPDATE_APPOINTMENT_TOOL, DELETE_APPOINTMENT_TOOL, LIST_APPOINTMENTS_TOOL ], }));