update_appointment
Modify an existing appointment's start time, notes, or patient ID by providing the appointment ID.
Instructions
Update an existing appointment
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appointment_id | Yes | Appointment ID | |
| starts_at | No | New start time (ISO 8601) | |
| notes | No | Updated notes | |
| patient_id | No | New patient ID |
Implementation Reference
- src/tools/appointments.ts:135-147 (handler)The async handler function for the 'update_appointment' tool. It destructures appointment_id from the input, passes remaining fields to client.updateAppointment(), and returns the updated appointment as JSON.
}, async ({ appointment_id, ...updateData }: any) => { try { const appointment = await client.updateAppointment(appointment_id, updateData); return { content: [{ type: 'text', text: JSON.stringify(appointment, null, 2) }] }; } catch (error) { throw new Error(`Failed to update appointment: ${error instanceof Error ? error.message : 'Unknown error'}`); } }); - src/tools/appointments.ts:122-133 (schema)The tool registration and input schema for 'update_appointment'. The schema requires 'appointment_id' and allows optional fields: 'starts_at', 'notes', and 'patient_id'.
// Update appointment server.tool('update_appointment', { description: 'Update an existing appointment', inputSchema: { type: 'object', properties: { appointment_id: { type: 'number', description: 'Appointment ID' }, starts_at: { type: 'string', description: 'New start time (ISO 8601)' }, notes: { type: 'string', description: 'Updated notes' }, patient_id: { type: 'number', description: 'New patient ID' } }, required: ['appointment_id'] - src/index.ts:58-59 (registration)The tool is registered via registerAppointmentTools(toolRegistry, clinikoClient) called in the main index.ts entry point.
registerPatientTools(toolRegistry, clinikoClient); registerAppointmentTools(toolRegistry, clinikoClient); - src/cliniko-client.ts:128-133 (helper)The ClinikoClient.updateAppointment() method that sends a PUT request to /appointments/{id} with the partial appointment data to update.
async updateAppointment(id: number, appointment: Partial<Appointment>): Promise<Appointment> { return this.request<Appointment>(`/appointments/${id}`, { method: 'PUT', body: JSON.stringify(appointment), }); }