check_availability
Verify calendar availability for scheduling meetings by providing account ID, start and end times, and optional attendees, powered by Microsoft MCP server.
Instructions
Check calendar availability for scheduling
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ||
| attendees | No | ||
| end | Yes | ||
| start | Yes |
Implementation Reference
- src/microsoft_mcp/tools.py:611-637 (handler)The core handler function implementing the check_availability tool. It uses the Microsoft Graph API to query calendar availability for the account and optional attendees within the specified time range.@mcp.tool def check_availability( account_id: str, start: str, end: str, attendees: str | list[str] | None = None, ) -> dict[str, Any]: """Check calendar availability for scheduling""" me_info = graph.request("GET", "/me", account_id) if not me_info or "mail" not in me_info: raise ValueError("Failed to get user email address") schedules = [me_info["mail"]] if attendees: attendees_list = [attendees] if isinstance(attendees, str) else attendees schedules.extend(attendees_list) payload = { "schedules": schedules, "startTime": {"dateTime": start, "timeZone": "UTC"}, "endTime": {"dateTime": end, "timeZone": "UTC"}, "availabilityViewInterval": 30, } result = graph.request("POST", "/me/calendar/getSchedule", account_id, json=payload) if not result: raise ValueError("Failed to check availability") return result