delete_patient
Archive a patient record using their unique ID to remove them from active practice management.
Instructions
Delete (archive) a patient
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| patient_id | Yes | Patient ID |
Implementation Reference
- src/tools/patients.ts:230-252 (registration)Registration of the 'delete_patient' tool via server.tool(). Registers the tool name, description, input schema, and handler.
// Delete (archive) patient server.tool('delete_patient', { description: 'Delete (archive) a patient', inputSchema: { type: 'object', properties: { patient_id: { type: 'number', description: 'Patient ID' } }, required: ['patient_id'] }, }, async ({ patient_id }: { patient_id: number }) => { try { await client.deletePatient(patient_id); return { content: [{ type: 'text', text: `Patient ${patient_id} has been archived successfully` }] }; } catch (error) { throw new Error(`Failed to delete patient: ${error instanceof Error ? error.message : 'Unknown error'}`); } }); - src/tools/patients.ts:240-252 (handler)Handler function that receives patient_id, calls client.deletePatient(), and returns a success message. On failure, throws an error.
}, async ({ patient_id }: { patient_id: number }) => { try { await client.deletePatient(patient_id); return { content: [{ type: 'text', text: `Patient ${patient_id} has been archived successfully` }] }; } catch (error) { throw new Error(`Failed to delete patient: ${error instanceof Error ? error.message : 'Unknown error'}`); } }); - src/tools/patients.ts:232-239 (schema)Input schema for delete_patient: requires a 'patient_id' (number).
description: 'Delete (archive) a patient', inputSchema: { type: 'object', properties: { patient_id: { type: 'number', description: 'Patient ID' } }, required: ['patient_id'] }, - src/cliniko-client.ts:80-84 (helper)Helper method in ClinikoClient that sends a DELETE request to /patients/{id} to archive the patient.
async deletePatient(id: number): Promise<void> { return this.request<void>(`/patients/${id}`, { method: 'DELETE', }); }