Skip to main content
Glama
andymillar84-cyber

mcp-cliniko

update_patient

Update an existing patient's demographic, contact, and address details using their unique patient ID.

Instructions

Update an existing patient

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patient_idYesPatient ID
first_nameNoPatient first name
last_nameNoPatient last name
titleNoTitle (Mr, Ms, Dr, etc)
preferred_nameNoPreferred name
date_of_birthNoDate of birth (YYYY-MM-DD)
sexNoBiological sex
emailNoEmail address
phone_numberNoPrimary phone number
address_line_1NoAddress line 1
address_line_2NoAddress line 2
suburbNoSuburb/City
postcodeNoPostcode
stateNoState/Province
countryNoCountry
medicare_numberNoMedicare number
medicare_reference_numberNoMedicare reference number

Implementation Reference

  • The 'update_patient' tool handler. It accepts a patient_id (required) plus optional fields, destructures them, maps fields to the API format (including phone_numbers as array and address as nested object), then calls client.updatePatient().
    // Update patient
    server.tool('update_patient', {
      description: 'Update an existing patient',
      inputSchema: {
        type: 'object',
        properties: {
          patient_id: { type: 'number', description: 'Patient ID' },
          first_name: { type: 'string', description: 'Patient first name' },
          last_name: { type: 'string', description: 'Patient last name' },
          title: { type: 'string', description: 'Title (Mr, Ms, Dr, etc)' },
          preferred_name: { type: 'string', description: 'Preferred name' },
          date_of_birth: { type: 'string', description: 'Date of birth (YYYY-MM-DD)' },
          sex: { type: 'string', enum: ['Male', 'Female', 'Other'], description: 'Biological sex' },
          email: { type: 'string', description: 'Email address' },
          phone_number: { type: 'string', description: 'Primary phone number' },
          address_line_1: { type: 'string', description: 'Address line 1' },
          address_line_2: { type: 'string', description: 'Address line 2' },
          suburb: { type: 'string', description: 'Suburb/City' },
          postcode: { type: 'string', description: 'Postcode' },
          state: { type: 'string', description: 'State/Province' },
          country: { type: 'string', description: 'Country' },
          medicare_number: { type: 'string', description: 'Medicare number' },
          medicare_reference_number: { type: 'string', description: 'Medicare reference number' }
        },
        required: ['patient_id']
      },
    }, async (input: any) => {
      try {
        const { patient_id, ...updateData } = input;
        const patientData: any = {};
    
        // Map simple fields
        if (updateData.first_name) patientData.first_name = updateData.first_name;
        if (updateData.last_name) patientData.last_name = updateData.last_name;
        if (updateData.title) patientData.title = updateData.title;
        if (updateData.preferred_name) patientData.preferred_name = updateData.preferred_name;
        if (updateData.date_of_birth) patientData.date_of_birth = updateData.date_of_birth;
        if (updateData.sex) patientData.sex = updateData.sex;
        if (updateData.email) patientData.email = updateData.email;
        if (updateData.medicare_number) patientData.medicare_number = updateData.medicare_number;
        if (updateData.medicare_reference_number) patientData.medicare_reference_number = updateData.medicare_reference_number;
    
        // Handle phone numbers
        if (updateData.phone_number) {
          patientData.phone_numbers = [{
            number: updateData.phone_number,
            type: 'Mobile'
          }];
        }
    
        // Handle address
        if (updateData.address_line_1 || updateData.suburb || updateData.postcode) {
          patientData.address = {};
          if (updateData.address_line_1) patientData.address.line_1 = updateData.address_line_1;
          if (updateData.address_line_2) patientData.address.line_2 = updateData.address_line_2;
          if (updateData.suburb) patientData.address.suburb = updateData.suburb;
          if (updateData.postcode) patientData.address.postcode = updateData.postcode;
          if (updateData.state) patientData.address.state = updateData.state;
          if (updateData.country) patientData.address.country = updateData.country;
        }
    
        const patient = await client.updatePatient(patient_id, patientData);
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(patient, null, 2)
          }]
        };
      } catch (error) {
        throw new Error(`Failed to update patient: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    });
  • Input schema for 'update_patient': patient_id (required number), plus optional fields: first_name, last_name, title, preferred_name, date_of_birth, sex (enum), email, phone_number, address fields, medicare fields.
    server.tool('update_patient', {
      description: 'Update an existing patient',
      inputSchema: {
        type: 'object',
        properties: {
          patient_id: { type: 'number', description: 'Patient ID' },
          first_name: { type: 'string', description: 'Patient first name' },
          last_name: { type: 'string', description: 'Patient last name' },
          title: { type: 'string', description: 'Title (Mr, Ms, Dr, etc)' },
          preferred_name: { type: 'string', description: 'Preferred name' },
          date_of_birth: { type: 'string', description: 'Date of birth (YYYY-MM-DD)' },
          sex: { type: 'string', enum: ['Male', 'Female', 'Other'], description: 'Biological sex' },
          email: { type: 'string', description: 'Email address' },
          phone_number: { type: 'string', description: 'Primary phone number' },
          address_line_1: { type: 'string', description: 'Address line 1' },
          address_line_2: { type: 'string', description: 'Address line 2' },
          suburb: { type: 'string', description: 'Suburb/City' },
          postcode: { type: 'string', description: 'Postcode' },
          state: { type: 'string', description: 'State/Province' },
          country: { type: 'string', description: 'Country' },
          medicare_number: { type: 'string', description: 'Medicare number' },
          medicare_reference_number: { type: 'string', description: 'Medicare reference number' }
        },
        required: ['patient_id']
      },
  • Tool registration via server.tool('update_patient', ...) inside registerPatientTools().
    server.tool('update_patient', {
  • The client method updatePatient() performs a PUT request to /patients/{id} with the JSON body, returning the updated Patient.
    async updatePatient(id: number, patient: Partial<Patient>): Promise<Patient> {
      return this.request<Patient>(`/patients/${id}`, {
        method: 'PUT',
        body: JSON.stringify(patient),
      });
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided. The description 'update' implies mutation but does not disclose side effects, permissions needed, or whether partial updates are allowed. For a write operation with 17 parameters, more transparency is needed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no waste. It front-loads the core purpose. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 17 parameters, no output schema, and no annotations, the description is too brief. It lacks constraints (e.g., required fields beyond patient_id, validation rules, idempotency). The high parameter count demands more behavioral context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (all 17 parameters have descriptions). The tool description adds no extra meaning beyond the schema, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description is clear: 'Update an existing patient' specifies the verb (update) and resource (patient). It distinguishes from sibling tools like create_patient or delete_patient, though it could be more specific about what fields are updatable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like create_patient or list_patients. No exclusions, prerequisites, or context provided. The agent must infer usage from the name.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/andymillar84-cyber/mcp-cliniko'

If you have feedback or need assistance with the MCP directory API, please join our Discord server