Skip to main content
Glama

check_appointment_availability

Find available appointment slots for a specific department within a date range to schedule patient visits efficiently.

Instructions

Check available appointment slots for a department and date range

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
department_idYesDepartment ID
provider_idNoProvider ID (optional - leave empty to check all providers)
appointment_typeNoAppointment type (optional)
start_dateYesStart date (YYYY-MM-DD)
end_dateYesEnd date (YYYY-MM-DD)

Implementation Reference

  • The primary MCP tool handler function that processes the tool call, extracts parameters, calls the service client, and formats the response as MCP content.
    async handleCheckAppointmentAvailability(args: any) {
      try {
        const { department_id, provider_id, appointment_type, start_date, end_date } = args;
    
        const availability = await this.client.getAppointmentAvailability({
          departmentid: department_id,
          providerid: provider_id,
          appointmenttype: appointment_type,
          startdate: start_date,
          enddate: end_date,
        });
    
        return {
          content: [
            {
              type: 'text' as const,
              text: JSON.stringify(availability, null, 2),
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text' as const,
              text: JSON.stringify({
                error: 'Failed to check appointment availability',
                message: error.message || 'Unknown error occurred',
                details: error.details || error.message,
                note: 'This endpoint may not be available in the preview/sandbox environment',
              }, null, 2),
            },
          ],
        };
      }
    }
  • The input schema and metadata definition for the check_appointment_availability tool, used for validation and tool listing.
    {
      name: 'check_appointment_availability',
      description: 'Check available appointment slots for a department and date range',
      inputSchema: {
        type: 'object',
        properties: {
          department_id: { type: 'string', description: 'Department ID' },
          provider_id: { type: 'string', description: 'Provider ID (optional - leave empty to check all providers)' },
          appointment_type: { type: 'string', description: 'Appointment type (optional)' },
          start_date: { type: 'string', description: 'Start date (YYYY-MM-DD)' },
          end_date: { type: 'string', description: 'End date (YYYY-MM-DD)' },
        },
        required: ['department_id', 'start_date', 'end_date'],
      },
    },
  • Tool dispatch registration in the MCP server's CallToolRequest handler switch statement.
    case 'check_appointment_availability':
      return await this.toolHandlers.handleCheckAppointmentAvailability(args);
  • Supporting service method that performs the actual HTTP request to the Athenahealth API /appointments/open endpoint to retrieve available slots.
    async getAppointmentAvailability(params: {
      departmentid: string;
      startdate: string;
      enddate: string;
      providerid?: string;
      appointmenttype?: string;
    }): Promise<any[]> {
      try {
        const response = await this.makeRequest<any>(
          `${this.config.practice_id}/appointments/open`,
          {
            method: 'GET',
            params,
          }
        );
    
        if (response.appointments && Array.isArray(response.appointments)) {
          return response.appointments;
        }
    
        if (Array.isArray(response)) {
          return response;
        }
    
        if (response.data && Array.isArray(response.data)) {
          return response.data;
        }
    
        return [];
      } catch (error: any) {
        console.error('Get appointment availability error:', error.message);
        throw error;
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does but lacks details on permissions needed, rate limits, whether results are real-time or cached, pagination, or error handling. For a read operation with no annotation coverage, this is a significant gap in transparency.

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 front-loads the core purpose without unnecessary words. Every part of the sentence earns its place by specifying the action, resource, and key constraints.

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 5 parameters with full schema coverage but no annotations or output schema, the description is minimally adequate. It covers the basic purpose but lacks behavioral context (e.g., response format, limitations), which is important for a tool with multiple optional parameters and no structured output documentation.

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 5 parameters thoroughly. The description adds no additional parameter semantics beyond implying date-range and department filtering, which is already covered in the schema. Baseline 3 is appropriate when the schema does the heavy lifting.

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 'check' and the resource 'available appointment slots', specifying the scope with 'for a department and date range'. It distinguishes from siblings like 'create_appointment' or 'list_departments', but doesn't explicitly differentiate from similar tools (e.g., if there were a 'search_appointments' sibling).

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?

The description implies usage for finding available slots before creating appointments, but doesn't explicitly state when to use this vs. alternatives like 'create_appointment' or other scheduling tools. No exclusions or prerequisites are mentioned, leaving usage context somewhat open-ended.

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