get_patient
Fetch a patient's complete record from Cliniko by providing their unique ID.
Instructions
Get a specific patient by ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| patient_id | Yes | Patient ID |
Implementation Reference
- src/tools/patients.ts:62-84 (handler)The get_patient tool handler: receives patient_id, calls client.getPatient(), and returns the patient as JSON.
// Get patient by ID server.tool('get_patient', { description: 'Get a specific patient by ID', inputSchema: { type: 'object', properties: { patient_id: { type: 'number', description: 'Patient ID' } }, required: ['patient_id'] }, }, async ({ patient_id }: { patient_id: number }) => { try { const patient = await client.getPatient(patient_id); return { content: [{ type: 'text', text: JSON.stringify(patient, null, 2) }] }; } catch (error) { throw new Error(`Failed to get patient: ${error instanceof Error ? error.message : 'Unknown error'}`); } }); - src/tools/patients.ts:63-71 (schema)Input schema for get_patient: requires a patient_id (number).
server.tool('get_patient', { description: 'Get a specific patient by ID', inputSchema: { type: 'object', properties: { patient_id: { type: 'number', description: 'Patient ID' } }, required: ['patient_id'] }, - src/index.ts:58-58 (registration)Registration call: registerPatientTools(toolRegistry, clinikoClient) is invoked at server startup.
registerPatientTools(toolRegistry, clinikoClient); - src/tools/patients.ts:29-29 (registration)Export function registerPatientTools that registers the tool on the server.
export function registerPatientTools(server: any, client: ClinikoClient) { - src/cliniko-client.ts:62-64 (helper)Helper method getPatient(id) on ClinikoClient: makes a GET request to /patients/{id} and returns a Patient.
async getPatient(id: number): Promise<Patient> { return this.request<Patient>(`/patients/${id}`); }