Skip to main content
Glama

create_appointment

Schedule patient appointments with providers by specifying patient, provider, department, appointment type, date, and time. Supports optional duration, reason, and notes for comprehensive scheduling within healthcare workflows.

Instructions

Create a new appointment for a patient

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patient_idYesPatient ID
provider_idYesProvider ID
department_idYesDepartment ID
appointment_typeYesAppointment type
dateYesAppointment date (YYYY-MM-DD)
start_timeYesStart time (HH:MM)
durationNoDuration in minutes (optional)
reasonNoReason for visit (optional)
notesNoAppointment notes (optional)

Implementation Reference

  • The primary handler function for the 'create_appointment' MCP tool. It processes input arguments, calls the AthenaHealthClient to create the appointment, logs the action, and returns the result or error in MCP format.
    async handleCreateAppointment(args: any) {
      try {
        const appointment = await this.client.createAppointment({
          patientid: args.patient_id,
          providerid: args.provider_id,
          departmentid: args.department_id,
          appointmenttype: args.appointment_type,
          date: args.date,
          starttime: args.start_time,
          duration: args.duration,
          reasonforvisit: args.reason,
          appointmentnotes: args.notes,
        });
    
        auditLog('APPOINTMENT_CREATE', {
          patientId: args.patient_id,
          result: 'success',
          resourceType: 'APPOINTMENT',
        });
    
        return {
          content: [
            {
              type: 'text' as const,
              text: JSON.stringify(appointment, null, 2),
            },
          ],
        };
      } catch (error: any) {
        console.error('Create appointment error:', error);
        return {
          content: [
            {
              type: 'text' as const,
              text: JSON.stringify({
                error: 'Failed to create appointment',
                message: error.message || 'Unknown error occurred',
                details: error.details || error.message,
                note: 'This endpoint may not be available in the preview/sandbox environment or may require specific appointment types',
              }, null, 2),
            },
          ],
        };
      }
  • The tool definition including name, description, and input schema validation for 'create_appointment'.
      name: 'create_appointment',
      description: 'Create a new appointment for a patient',
      inputSchema: {
        type: 'object',
        properties: {
          patient_id: { type: 'string', description: 'Patient ID' },
          provider_id: { type: 'string', description: 'Provider ID' },
          department_id: { type: 'string', description: 'Department ID' },
          appointment_type: { type: 'string', description: 'Appointment type' },
          date: { type: 'string', description: 'Appointment date (YYYY-MM-DD)' },
          start_time: { type: 'string', description: 'Start time (HH:MM)' },
          duration: { type: 'string', description: 'Duration in minutes (optional)' },
          reason: { type: 'string', description: 'Reason for visit (optional)' },
          notes: { type: 'string', description: 'Appointment notes (optional)' },
        },
        required: ['patient_id', 'provider_id', 'department_id', 'appointment_type', 'date', 'start_time'],
      },
    },
  • Registration of all tool definitions (including create_appointment) via the ListToolsRequestHandler in the MCP server.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools: toolDefinitions };
    });
  • Dispatch registration in the MCP server's CallToolRequestHandler switch statement that routes 'create_appointment' calls to the specific handler method.
    case 'create_appointment':
      return await this.toolHandlers.handleCreateAppointment(args);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states 'Create a new appointment' which implies a write operation, but doesn't address permissions, side effects, error conditions, or what happens on success. This is inadequate for a mutation tool with zero annotation coverage.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded with the essential information.

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 mutation tool with 9 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what happens after creation, error handling, or how this differs from similar tools. The agent would need to guess about behavioral aspects and usage 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%, so the schema already documents all 9 parameters thoroughly. The description adds no additional parameter information beyond what's in the schema, meeting the baseline expectation but not providing extra value.

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 clearly states the verb 'Create' and the resource 'appointment for a patient', making the purpose specific and understandable. However, it doesn't differentiate from sibling tools like 'create_encounter' or 'check_appointment_availability', which could cause confusion in tool selection.

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?

The description provides no guidance on when to use this tool versus alternatives like 'create_encounter' or 'check_appointment_availability'. There's no mention of prerequisites, constraints, or typical use cases, leaving the agent without contextual usage information.

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/ophydami/Athenahealth-MCP'

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