Skip to main content
Glama
by ricleedo

calendar-get-event

Retrieve specific calendar event details using the event ID to access event information from Google Calendar.

Instructions

Get a specific calendar event by ID

Input Schema

NameRequiredDescriptionDefault
calendarIdNoCalendar ID - Available options: 'primary' (Primary Calendar)primary
eventIdYesEvent ID

Input Schema (JSON Schema)

{ "properties": { "calendarId": { "default": "primary", "description": "Calendar ID - Available options: 'primary' (Primary Calendar)", "type": "string" }, "eventId": { "description": "Event ID", "type": "string" } }, "required": [ "eventId" ], "type": "object" }

Implementation Reference

  • Implementation of the getEvent handler function that retrieves a specific calendar event by ID using the Google Calendar API and formats it as Markdown.
    // Get specific event function export async function getEvent( params: z.infer<ReturnType<typeof getEventSchema>> ) { try { const auth = createCalendarAuth(); const calendar = google.calendar({ version: "v3", auth }); const response = await calendar.events.get({ calendarId: params.calendarId, eventId: params.eventId, }); const event = response.data; const eventDetail = { id: event.id, summary: event.summary, description: event.description, location: event.location, start: event.start, end: event.end, attendees: event.attendees?.map((a) => ({ email: a.email, displayName: a.displayName, responseStatus: a.responseStatus, })), creator: event.creator, organizer: event.organizer, htmlLink: event.htmlLink, status: event.status, created: event.created, updated: event.updated, recurrence: event.recurrence, }; return { content: [ { type: "text" as const, text: formatEventToMarkdown(eventDetail), }, ], }; } catch (error) { return { content: [ { type: "text" as const, text: `Error getting event: ${ error instanceof Error ? error.message : String(error) }`, }, ], }; } }
  • Zod schema definition for validating inputs to the calendar-get-event tool: requires eventId, optional calendarId.
    export const getEventSchema = () => z.object({ eventId: z.string().describe("Event ID"), calendarId: z .string() .default("primary") .describe(getCalendarDescription()), });
  • src/index.ts:233-240 (registration)
    Registration of the "calendar-get-event" tool in the MCP server, linking to getEvent handler and schema.
    server.tool( "calendar-get-event", "Get a specific calendar event by ID", getEventSchema().shape, async (params) => { return await getEvent(params); } );

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/ricleedo/Google-Service-MCP'

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