get_business_appointments
Retrieve scheduled appointments for a Microsoft Bookings business within a specified date range using business ID and optional start/end dates.
Instructions
Get appointments for a Bookings business
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| businessId | Yes | ID of the Bookings business | |
| startDate | No | Start date for appointments (ISO format) | |
| endDate | No | End date for appointments (ISO format) |
Implementation Reference
- src/index.ts:230-251 (handler)The handler function that fetches appointments for a Bookings business using Microsoft Graph API, with optional startDate and endDate filters.private async getBusinessAppointments(businessId: string, startDate?: string, endDate?: string) { let api = this.graphClient .api(`/solutions/bookingBusinesses/${businessId}/appointments`); if (startDate || endDate) { const filter = []; if (startDate) filter.push(`start ge ${startDate}`); if (endDate) filter.push(`end le ${endDate}`); api = api.filter(filter.join(' and ')); } const response = await api.get(); return { content: [ { type: 'text', text: JSON.stringify(response.value, null, 2), }, ], }; }
- src/index.ts:120-137 (schema)Input schema defining parameters for the get_business_appointments tool: businessId (required), startDate and endDate (optional).inputSchema: { type: 'object', properties: { businessId: { type: 'string', description: 'ID of the Bookings business', }, startDate: { type: 'string', description: 'Start date for appointments (ISO format)', }, endDate: { type: 'string', description: 'End date for appointments (ISO format)', }, }, required: ['businessId'], },
- src/index.ts:117-138 (registration)Tool registration in the ListTools response, including name, description, and input schema.{ name: 'get_business_appointments', description: 'Get appointments for a Bookings business', inputSchema: { type: 'object', properties: { businessId: { type: 'string', description: 'ID of the Bookings business', }, startDate: { type: 'string', description: 'Start date for appointments (ISO format)', }, endDate: { type: 'string', description: 'End date for appointments (ISO format)', }, }, required: ['businessId'], }, },
- src/index.ts:155-166 (registration)Registration of the tool handler in the CallToolRequest switch statement.case 'get_business_appointments': { const args = request.params.arguments as { businessId: string; startDate?: string; endDate?: string; }; return await this.getBusinessAppointments( args.businessId, args.startDate, args.endDate ); }