calendar_events_work
Retrieve events from configured work calendars within a specified time range, with optional limit on results.
Instructions
List events for the configured work account calendars.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| time_min | Yes | ||
| time_max | Yes | ||
| max_results | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- tools.py:57-69 (handler)The MCP tool handler function `calendar_events_work`. It loads work account credentials and delegates to the `calendar_events` API function with optional calendar name filters.
@mcp.tool() def calendar_events_work(time_min: str, time_max: str, max_results: int = 50) -> dict[str, Any]: """List events for the configured work account calendars.""" result = _load_or_error("work") if isinstance(result, dict): return result return calendar_events( result, time_min, time_max, max_results, calendar_names=_work_calendar_filters(), ) - api.py:98-103 (schema)The `calendar_events` API function that this tool delegates to. It accepts credentials, time range, max results, and optional calendar name filters, queries the Google Calendar API, and returns structured event data.
def calendar_events( creds: Credentials, time_min: str, time_max: str, max_results: int = 50, calendar_names: list[str] | None = None, - tools.py:57-58 (registration)The `@mcp.tool()` decorator registers `calendar_events_work` as an MCP tool with the FastMCP server instance.
@mcp.tool() def calendar_events_work(time_min: str, time_max: str, max_results: int = 50) -> dict[str, Any]: - tools.py:24-27 (helper)The `_work_calendar_filters()` helper reads the `GOOGLE_MCP_WORK_CALENDAR` env var to optionally filter work calendars by name/ID.
def _work_calendar_filters() -> list[str] | None: """Return optional work calendar filter from env.""" raw = os.getenv(WORK_CALENDAR_FILTER_ENV, "").strip() return [raw] if raw else None - config.py:31-31 (helper)The `WORK_CALENDAR_FILTER_ENV` constant defining the environment variable name `GOOGLE_MCP_WORK_CALENDAR`.
WORK_CALENDAR_FILTER_ENV = "GOOGLE_MCP_WORK_CALENDAR"