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
| Name | Required | Description | Default |
|---|---|---|---|
| calendarId | No | Optional: ID of calendar to use (defaults to primary if not specified) | |
| eventId | Yes | ID of the event to retrieve |
Implementation Reference
- handlers/calendar.ts:111-124 (handler)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, }; }
- tools/calendar/index.ts:114-132 (schema)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"], }, };
- server-setup.ts:112-116 (registration)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 );
- utils/helper.ts:57-66 (helper)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") ); }