Skip to main content
Glama
andymillar84-cyber

mcp-cliniko

cancel_appointment

Cancel an appointment in your healthcare practice by providing the appointment ID and optional reason for cancellation.

Instructions

Cancel an appointment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appointment_idYesAppointment ID
cancellation_reasonNoReason for cancellation

Implementation Reference

  • Registration of the 'cancel_appointment' tool with MCP server. Defines input schema (appointment_id required, cancellation_reason optional) and the handler that calls client.cancelAppointment().
    // Cancel appointment
    server.tool('cancel_appointment', {
      description: 'Cancel an appointment',
      inputSchema: {
        type: 'object',
        properties: {
          appointment_id: { type: 'number', description: 'Appointment ID' },
          cancellation_reason: { type: 'string', description: 'Reason for cancellation' }
        },
        required: ['appointment_id']
      },
    }, async ({ appointment_id, cancellation_reason }: { appointment_id: number; cancellation_reason?: string }) => {
      try {
        const appointment = await client.cancelAppointment(appointment_id, cancellation_reason);
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(appointment, null, 2)
          }]
        };
      } catch (error) {
        throw new Error(`Failed to cancel appointment: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    });
  • The actual handler function for cancel_appointment. Receives appointment_id and optional cancellation_reason, calls the ClinikoClient cancelAppointment method, returns the cancelled appointment as JSON.
    }, async ({ appointment_id, cancellation_reason }: { appointment_id: number; cancellation_reason?: string }) => {
      try {
        const appointment = await client.cancelAppointment(appointment_id, cancellation_reason);
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(appointment, null, 2)
          }]
        };
      } catch (error) {
        throw new Error(`Failed to cancel appointment: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
  • Input schema (defined inline) for cancel_appointment. appointment_id (number, required) and cancellation_reason (string, optional).
    inputSchema: {
      type: 'object',
      properties: {
        appointment_id: { type: 'number', description: 'Appointment ID' },
        cancellation_reason: { type: 'string', description: 'Reason for cancellation' }
      },
      required: ['appointment_id']
    },
  • ClinikoClient.cancelAppointment() method. Sends a PUT request to /appointments/{id}/cancel with an optional cancellation_reason in the request body. This is the API client helper that executes the actual HTTP request.
    async cancelAppointment(id: number, reason?: string): Promise<Appointment> {
      return this.request<Appointment>(`/appointments/${id}/cancel`, {
        method: 'PUT',
        body: JSON.stringify({ cancellation_reason: reason }),
      });
    }
  • src/index.ts:58-59 (registration)
    Top-level registration: registerAppointmentTools(toolRegistry, clinikoClient) is called in index.ts, which wires up all appointment tools including cancel_appointment.
    registerPatientTools(toolRegistry, clinikoClient);
    registerAppointmentTools(toolRegistry, clinikoClient);
Behavior2/5

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

No annotations are present, and the description does not disclose behavioral traits such as whether cancellation is reversible, what side effects occur, or required permissions. For a mutation tool, this is insufficient.

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?

The description is a single sentence, which is concise but omits important details that could be included without substantial length. It is minimally adequate but not optimized for value.

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 the lack of annotations and output schema, the description fails to provide sufficient context about the tool's effect, prerequisites, or post-conditions. For a cancellation tool, this is incomplete.

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?

The input schema already provides clear descriptions for both parameters (appointment_id and cancellation_reason), achieving 100% coverage. The tool description adds no additional meaning beyond what the schema offers.

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

Purpose3/5

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

The description clearly states the verb 'cancel' and resource 'appointment', but does not differentiate from sibling tool 'delete_appointment', which likely has different semantics. This ambiguity lowers clarity.

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 is provided on when to use cancel vs. other appointment management tools (e.g., delete_appointment). The description lacks context for decision-making.

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