check_appointment_availability
Find available appointment slots for a specific department within your desired date range. Check provider availability and appointment types to schedule patient visits.
Instructions
Check available appointment slots for a department and date range
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appointment_type | No | Appointment type (optional) | |
| department_id | Yes | Department ID | |
| end_date | Yes | End date (YYYY-MM-DD) | |
| provider_id | No | Provider ID (optional - leave empty to check all providers) | |
| start_date | Yes | Start date (YYYY-MM-DD) |
Input Schema (JSON Schema)
{
"properties": {
"appointment_type": {
"description": "Appointment type (optional)",
"type": "string"
},
"department_id": {
"description": "Department ID",
"type": "string"
},
"end_date": {
"description": "End date (YYYY-MM-DD)",
"type": "string"
},
"provider_id": {
"description": "Provider ID (optional - leave empty to check all providers)",
"type": "string"
},
"start_date": {
"description": "Start date (YYYY-MM-DD)",
"type": "string"
}
},
"required": [
"department_id",
"start_date",
"end_date"
],
"type": "object"
}
Implementation Reference
- src/handlers/tool-handlers.ts:362-397 (handler)The primary handler function that implements the tool logic. It extracts arguments, calls the AthenaHealthClient's getAppointmentAvailability method, formats the JSON response, and handles errors gracefully.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), }, ], }; } }
- src/definitions/tools.ts:126-140 (schema)The tool schema definition specifying the name, description, and input validation schema used by the MCP server.{ 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'], }, },
- src/mcp-server.ts:200-201 (registration)Registration of the tool in the MCP server's tool call handler switch statement, delegating execution to the ToolHandlers instance.case 'check_appointment_availability': return await this.toolHandlers.handleCheckAppointmentAvailability(args);