Skip to main content
Glama
andymillar84-cyber

mcp-cliniko

list_patients

Search for patients by name, email, or phone, and paginate results to manage your patient list efficiently.

Instructions

List or search for patients

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qNoSearch query (searches name, email, phone)
pageNoPage number
per_pageNoResults per page (max 100)

Implementation Reference

  • The tool handler for 'list_patients'. Registers the tool via server.tool() with an input schema for q, page, per_page. Calls clinikoClient.listPatients() and formats the response.
    server.tool('list_patients', {
      description: 'List or search for patients',
      inputSchema: {
        type: 'object',
        properties: {
          q: { type: 'string', description: 'Search query (searches name, email, phone)' },
          page: { type: 'number', description: 'Page number' },
          per_page: { type: 'number', description: 'Results per page (max 100)' }
        }
      },
    }, async ({ q, page, per_page }: z.infer<typeof PatientSearchSchema>) => {
      try {
        const response = await client.listPatients({ q, page, per_page });
        const patients = response.patients || [];
        
        return {
          content: [{
            type: 'text',
            text: JSON.stringify({
              patients,
              total_entries: response.total_entries,
              page: page || 1,
              has_more: !!response.links.next
            }, null, 2)
          }]
        };
      } catch (error) {
        throw new Error(`Failed to list patients: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    });
  • The PatientSearchSchema Zod schema that defines validation for the tool's input parameters (q, page, per_page).
    const PatientSearchSchema = z.object({
      q: z.string().optional().describe('Search query (searches name, email, phone)'),
      page: z.number().optional().describe('Page number'),
      per_page: z.number().optional().describe('Results per page (max 100)'),
    });
  • The registerPatientTools function which is called from src/index.ts to register the tool on the server. The tool named 'list_patients' is registered inside this function.
    export function registerPatientTools(server: any, client: ClinikoClient) {
      // List/Search patients
  • src/index.ts:44-48 (registration)
    The toolRegistry helper used to register tools. The server.tool() call in patients.ts stores the schema and handler in a Map.
    const toolRegistry = {
      tool(name: string, schema: any, handler: any) {
        tools.set(name, { schema, handler });
      }
    };
  • The ClinikoClient.listPatients() method that makes the actual API call to GET /patients with optional query params (page, per_page, q).
    async listPatients(params?: { page?: number; per_page?: number; q?: string }): Promise<ClinikoListResponse<Patient>> {
      const searchParams = new URLSearchParams();
      if (params?.page) searchParams.append('page', params.page.toString());
      if (params?.per_page) searchParams.append('per_page', params.per_page.toString());
      if (params?.q) searchParams.append('q', params.q);
      
      return this.request<ClinikoListResponse<Patient>>(`/patients${searchParams.toString() ? '?' + searchParams.toString() : ''}`);
    }
Behavior2/5

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

No annotations provided, so the description carries full burden. It offers no behavioral details such as pagination behavior, default ordering, authentication requirements, or what happens when no query is provided. Only states 'List or search' without elaboration.

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

Conciseness2/5

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

Extremely concise at 4 words, but lacks necessary information. While it is brief, it sacrifices completeness. A good concise description would include key details like pagination or search scope.

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?

For a list/search tool with 3 parameters and no output schema, the description is incomplete. It does not mention pagination behavior, search field specifics, or any constraints. Sibling tools exist that provide more 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?

Input schema has 100% description coverage, so the schema already explains the parameters. The description adds no extra meaning beyond the schema. Baseline score of 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?

Description clearly states 'List or search for patients' which identifies the action and resource. It implies listing all patients or searching by query, but does not explicitly differentiate from sibling tools like get_patient (single patient) or list_appointments. However, the verb-resource combination is specific enough.

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 (e.g., get_patient, list_invoices). The description does not provide context on optimal use cases or limitations.

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