Skip to main content
Glama
giantrotta24

google-mcp

by giantrotta24

calendar_events_personal

Retrieve personal Google Calendar events within a given time range to review your schedule and plan ahead.

Instructions

List events for the configured personal account calendars.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
time_minYes
time_maxYes
max_resultsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • tools.py:48-54 (handler)
    The @mcp.tool() decorated handler function 'calendar_events_personal' that loads personal account credentials and delegates to the calendar_events API function.
    @mcp.tool()
    def calendar_events_personal(time_min: str, time_max: str, max_results: int = 50) -> dict[str, Any]:
        """List events for the configured personal account calendars."""
        result = _load_or_error("personal")
        if isinstance(result, dict):
            return result
        return calendar_events(result, time_min, time_max, max_results)
  • The function signature defines the input schema: time_min (str), time_max (str), max_results (int, default 50). The return type is dict[str, Any].
    def calendar_events_personal(time_min: str, time_max: str, max_results: int = 50) -> dict[str, Any]:
  • tools.py:48-48 (registration)
    The tool is registered via the @mcp.tool() decorator on line 48, which attaches it to the FastMCP server instance created on line 13.
    @mcp.tool()
  • The _load_or_error helper loads credentials for the given account key and returns either a Credentials object or an error dict.
    def _load_or_error(account: Account):
        """Return credentials or an error envelope if Keychain lookup fails."""
        try:
            return load_credentials(account)
        except RuntimeError as e:
            return {"ok": False, "error": str(e), "code": 401}
  • api.py:98-197 (helper)
    The calendar_events function in api.py that performs the actual Google Calendar API queries. Called by calendar_events_personal with no calendar_names filter (personal gets all calendars).
    def calendar_events(
        creds: Credentials,
        time_min: str,
        time_max: str,
        max_results: int = 50,
        calendar_names: list[str] | None = None,
    ) -> dict[str, Any]:
        """List calendar events across all owned and writable calendars."""
        from google.auth.exceptions import RefreshError
        from googleapiclient.discovery import build
    
        max_results = min(max_results, 100)
    
        try:
            service = build("calendar", "v3", credentials=creds)
    
            all_calendars: list[dict[str, Any]] = []
            page_token: str | None = None
            while True:
                response = service.calendarList().list(pageToken=page_token).execute(num_retries=3)
                all_calendars.extend(response.get("items", []))
                page_token = response.get("nextPageToken")
                if not page_token:
                    break
    
            owned_calendars = [
                cal for cal in all_calendars if cal.get("accessRole") in ("owner", "writer")
            ]
    
            if calendar_names is not None:
                owned_calendars = [
                    cal
                    for cal in owned_calendars
                    if cal.get("summary", "") in calendar_names or cal.get("id", "") in calendar_names
                ]
    
            results: list[dict[str, Any]] = []
    
            for cal in owned_calendars:
                events_for_calendar = 0
                events_page_token: str | None = None
                while events_for_calendar < max_results:
                    remaining = max_results - events_for_calendar
                    events_response = (
                        service.events()
                        .list(
                            calendarId=cal["id"],
                            timeMin=time_min,
                            timeMax=time_max,
                            maxResults=min(remaining, max_results),
                            singleEvents=True,
                            orderBy="startTime",
                            pageToken=events_page_token,
                        )
                        .execute(num_retries=3)
                    )
    
                    for event in events_response.get("items", []):
                        if events_for_calendar >= max_results:
                            break
    
                        start_raw = event.get("start", {})
                        end_raw = event.get("end", {})
                        all_day = "date" in start_raw and "dateTime" not in start_raw
    
                        attendees = [
                            {"name": a.get("displayName", ""), "email": a.get("email", "")}
                            for a in event.get("attendees", [])
                        ]
    
                        results.append(
                            {
                                "id": event["id"],
                                "summary": event.get("summary", ""),
                                "start": start_raw.get("date")
                                if all_day
                                else start_raw.get("dateTime", ""),
                                "end": end_raw.get("date") if all_day else end_raw.get("dateTime", ""),
                                "location": event.get("location"),
                                "description": event.get("description"),
                                "attendees": attendees,
                                "status": event.get("status", "confirmed"),
                                "all_day": all_day,
                            }
                        )
                        events_for_calendar += 1
    
                    events_page_token = events_response.get("nextPageToken")
                    if not events_page_token:
                        break
    
            results.sort(key=lambda e: e["start"] or "")
            return {"ok": True, "data": results}
    
        except HttpError as e:
            return _parse_http_error(e)
        except RefreshError as e:
            return {"ok": False, "error": f"token refresh failed: {e}", "code": 401}
        except Exception as e:
            return {"ok": False, "error": f"upstream failure: {type(e).__name__}", "code": 503}
Behavior2/5

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

No annotations are provided, and the description only says 'List events', which implies a read operation. It omits behavioral details such as authentication requirements, rate limits, pagination, or response format, leaving the agent underinformed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no wasted words. It is appropriately concise but could include more essential details without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having an output schema, the description fails to convey parameter semantics, usage context, or behavioral expectations. It is incomplete for correct agent invocation without additional information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description does not explain the parameters at all. The parameter names 'time_min', 'time_max', and 'max_results' are somewhat self-explanatory but lack specifics on format or constraints, which is insufficient.

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 'List' and the resource 'events' for 'personal account calendars', distinguishing it from the sibling 'calendar_events_work'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like 'calendar_events_work' or 'gmail_search_*'. The description does not specify exclusions or prerequisites.

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/giantrotta24/multi-account-google-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server