Skip to main content
Glama

google_calendar_get_event

Retrieve detailed event information by specifying the event ID and optional calendar ID, enabling integration with Google Calendar through the Google MCP server.

Instructions

Get detailed information about a specific event

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
calendarIdNoOptional: ID of calendar to use (defaults to primary if not specified)
eventIdYesID of the event to retrieve

Implementation Reference

  • The primary handler function executing the tool logic: validates input with isGetEventArgs, retrieves the event via GoogleCalendar.getEvent, and returns formatted response.
    export async function handleCalendarGetEvent(
      args: any,
      googleCalendarInstance: GoogleCalendar
    ) {
      if (!isGetEventArgs(args)) {
        throw new Error("Invalid arguments for google_calendar_get_event");
      }
      const { eventId, calendarId } = args;
      const result = await googleCalendarInstance.getEvent(eventId, calendarId);
      return {
        content: [{ type: "text", text: result }],
        isError: false,
      };
    }
  • Defines the tool's metadata, description, and input schema (JSON Schema) for validation in MCP.
    export const GET_EVENT_TOOL: Tool = {
      name: "google_calendar_get_event",
      description: "Get detailed information about a specific event",
      inputSchema: {
        type: "object",
        properties: {
          eventId: {
            type: "string",
            description: "ID of the event to retrieve",
          },
          calendarId: {
            type: "string",
            description:
              "Optional: ID of calendar to use (defaults to primary if not specified)",
          },
        },
        required: ["eventId"],
      },
    };
  • Registers the tool handler in the MCP server's call tool request dispatcher (switch case routing).
    case "google_calendar_get_event":
      return await calendarHandlers.handleCalendarGetEvent(
        args,
        googleCalendarInstance
      );
  • Type guard function for runtime validation of tool arguments, matching the input schema.
    export function isGetEventArgs(args: any): args is {
      eventId: string;
      calendarId?: string;
    } {
      return (
        args &&
        typeof args.eventId === "string" &&
        (args.calendarId === undefined || typeof args.calendarId === "string")
      );
    }

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/vakharwalad23/google-mcp'

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