Skip to main content
Glama
andymillar84-cyber

mcp-cliniko

create_patient

Adds a new patient record to Cliniko with required first and last names, plus optional details like date of birth, contact, and address.

Instructions

Create a new patient

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
first_nameYesPatient first name
last_nameYesPatient 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 handler function for create_patient tool. It maps input fields, builds patientData object (including nested phone_numbers and address), calls client.createPatient(), and returns the created patient as JSON.
    }, async (input: z.infer<typeof PatientCreateSchema>) => {
      try {
        const patientData: any = {
          first_name: input.first_name,
          last_name: input.last_name,
        };
    
        if (input.title) patientData.title = input.title;
        if (input.preferred_name) patientData.preferred_name = input.preferred_name;
        if (input.date_of_birth) patientData.date_of_birth = input.date_of_birth;
        if (input.sex) patientData.sex = input.sex;
        if (input.email) patientData.email = input.email;
        if (input.medicare_number) patientData.medicare_number = input.medicare_number;
        if (input.medicare_reference_number) patientData.medicare_reference_number = input.medicare_reference_number;
    
        // Handle phone numbers
        if (input.phone_number) {
          patientData.phone_numbers = [{
            number: input.phone_number,
            type: 'Mobile'
          }];
        }
    
        // Handle address
        if (input.address_line_1 || input.suburb || input.postcode) {
          patientData.address = {};
          if (input.address_line_1) patientData.address.line_1 = input.address_line_1;
          if (input.address_line_2) patientData.address.line_2 = input.address_line_2;
          if (input.suburb) patientData.address.suburb = input.suburb;
          if (input.postcode) patientData.address.postcode = input.postcode;
          if (input.state) patientData.address.state = input.state;
          if (input.country) patientData.address.country = input.country;
        }
    
        const patient = await client.createPatient(patientData);
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(patient, null, 2)
          }]
        };
      } catch (error) {
        throw new Error(`Failed to create patient: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    });
  • Zod schema (PatientCreateSchema) defining input validation for create_patient, including required first_name/last_name and optional fields like title, email, sex, address, medicare info.
    const PatientCreateSchema = z.object({
      first_name: z.string().describe('Patient first name'),
      last_name: z.string().describe('Patient last name'),
      title: z.string().optional().describe('Title (Mr, Ms, Dr, etc)'),
      preferred_name: z.string().optional().describe('Preferred name'),
      date_of_birth: z.string().optional().describe('Date of birth (YYYY-MM-DD)'),
      sex: z.enum(['Male', 'Female', 'Other']).optional().describe('Biological sex'),
      email: z.string().email().optional().describe('Email address'),
      phone_number: z.string().optional().describe('Primary phone number'),
      address_line_1: z.string().optional().describe('Address line 1'),
      address_line_2: z.string().optional().describe('Address line 2'),
      suburb: z.string().optional().describe('Suburb/City'),
      postcode: z.string().optional().describe('Postcode'),
      state: z.string().optional().describe('State/Province'),
      country: z.string().optional().describe('Country'),
      medicare_number: z.string().optional().describe('Medicare number'),
      medicare_reference_number: z.string().optional().describe('Medicare reference number'),
    });
  • Registration of the 'create_patient' tool via server.tool(), including the inputSchema definition with required fields first_name and last_name.
    server.tool('create_patient', {
      description: 'Create a new patient',
      inputSchema: {
        type: 'object',
        properties: {
          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: ['first_name', 'last_name']
      },
  • src/index.ts:58-58 (registration)
    Registration call: registerPatientTools(toolRegistry, clinikoClient) wires up all patient tools including create_patient into the MCP server.
    registerPatientTools(toolRegistry, clinikoClient);
  • The ClinikoClient.createPatient() method that sends a POST request to /patients with the patient data JSON body.
    async createPatient(patient: Partial<Patient>): Promise<Patient> {
      return this.request<Patient>('/patients', {
        method: 'POST',
        body: JSON.stringify(patient),
      });
    }
Behavior1/5

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

No annotations provided, and description fails to disclose behavioral traits like success response, error conditions, or side effects beyond the bare action.

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

Conciseness3/5

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

Extremely concise (one sentence) but too terse; lacks essential information for a tool with 16 parameters and no annotations.

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

Completeness1/5

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

Given 16 parameters, no output schema, and no annotations, the description is severely incomplete, omitting return values, prerequisites, and behavioral details.

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 coverage is 100% with descriptions for all parameters; description adds no extra meaning, defaulting to baseline 3.

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

Purpose5/5

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

Description clearly states 'Create a new patient', with a specific verb and resource, differentiating from siblings like update_patient or delete_patient.

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 such as update_patient or create_appointment; lacks context for appropriate use.

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