Skip to main content
Glama
andymillar84-cyber

mcp-cliniko

get_appointment_invoices

Retrieve invoices linked to a specific appointment using its ID. Access billing details from the Cliniko system for a given appointment.

Instructions

Get invoices for a specific appointment (READ-ONLY)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appointment_idYesAppointment ID

Implementation Reference

  • Registration of the 'get_appointment_invoices' tool using server.tool(), with input schema requiring 'appointment_id' and handler that calls client.getAppointmentInvoices.
    server.tool('get_appointment_invoices', {
      description: 'Get invoices for a specific appointment (READ-ONLY)',
      inputSchema: {
        type: 'object',
        properties: {
          appointment_id: { type: 'number', description: 'Appointment ID' }
        },
        required: ['appointment_id']
      },
    }, async ({ appointment_id }: { appointment_id: number }) => {
      try {
        const result = await client.getAppointmentInvoices(appointment_id);
        const invoices = result.invoices || [];
        
        return {
          content: [{
            type: 'text',
            text: invoices.length > 0 
              ? `Found ${invoices.length} invoice(s) for appointment ${appointment_id}:\n\n` +
                invoices.map((inv: any) => 
                  `- Invoice #${inv.invoice_number || inv.id}: ${inv.status} ($${inv.total || 0})`
                ).join('\n')
              : `No invoices found for appointment ${appointment_id}. Invoices must be created manually in Cliniko.`
          }],
          data: result
        };
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `Error fetching appointment invoices: ${error instanceof Error ? error.message : String(error)}`
          }]
        };
      }
    });
  • The handler function for get_appointment_invoices. Calls client.getAppointmentInvoices(appointment_id), formats the invoices into a text response showing invoice number, status, and total, or a message if none found.
    }, async ({ appointment_id }: { appointment_id: number }) => {
      try {
        const result = await client.getAppointmentInvoices(appointment_id);
        const invoices = result.invoices || [];
        
        return {
          content: [{
            type: 'text',
            text: invoices.length > 0 
              ? `Found ${invoices.length} invoice(s) for appointment ${appointment_id}:\n\n` +
                invoices.map((inv: any) => 
                  `- Invoice #${inv.invoice_number || inv.id}: ${inv.status} ($${inv.total || 0})`
                ).join('\n')
              : `No invoices found for appointment ${appointment_id}. Invoices must be created manually in Cliniko.`
          }],
          data: result
        };
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `Error fetching appointment invoices: ${error instanceof Error ? error.message : String(error)}`
          }]
        };
      }
    });
  • Input schema for get_appointment_invoices: expects a required 'appointment_id' (type: number).
    description: 'Get invoices for a specific appointment (READ-ONLY)',
    inputSchema: {
      type: 'object',
      properties: {
        appointment_id: { type: 'number', description: 'Appointment ID' }
      },
      required: ['appointment_id']
    },
  • The getAppointmentInvoices method on ClinikoClient, which makes a GET request to /appointments/{appointmentId}/invoices and returns a ClinikoListResponse<Invoice>.
    async getAppointmentInvoices(appointmentId: number): Promise<ClinikoListResponse<Invoice>> {
      return this.request<ClinikoListResponse<Invoice>>(`/appointments/${appointmentId}/invoices`);
    }
Behavior3/5

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

With no annotations provided, the description carries full burden. It correctly states 'READ-ONLY', signaling no mutation. However, it does not disclose whether the tool returns a list or single invoice, pagination behavior, or error handling. The minimal disclosure meets basic needs but lacks completeness.

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?

Extremely concise at 6 words, front-loaded with the key purpose. Every word earns its place with no redundancy or fluff.

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

Completeness3/5

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

Given the simple one-parameter tool and no output schema, the description is minimally sufficient but does not explain the return value (list of invoices, summary vs full details). The presence of siblings like 'list_invoices' and 'get_invoice' creates a need for slightly more precision, yet the description barely differentiates beyond the appointment scope.

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 fully describes the single parameter 'appointment_id' as 'Appointment ID'. The description adds no extra meaning about format, range, or how to obtain the ID. Per guidelines, with 100% schema coverage, baseline is 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?

The description clearly states the action 'Get invoices' and the specific resource 'for a specific appointment'. The '(READ-ONLY)' suffix adds behavioral clarity. It distinguishes from siblings like 'list_invoices' (unfiltered) and 'get_patient_invoices' (by patient).

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

Usage Guidelines3/5

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

No explicit guidance on when to use this tool versus alternatives like 'list_invoices' or 'get_patient_invoices'. The context is implied by the name and description, but explicit when-to-use or when-not-to-use instructions are missing.

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