Skip to main content
Glama
ricleedo

Google Services MCP Server

by ricleedo

calendar-get-event

Retrieve specific calendar events by ID to access event details, manage schedules, and coordinate activities using Google Calendar data.

Instructions

Get a specific calendar event by ID

Input Schema

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

Implementation Reference

  • The main handler function that retrieves a specific calendar event using Google Calendar API's events.get method, extracts relevant details, and formats the response as Markdown using formatEventToMarkdown.
    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 defining input parameters for the calendar-get-event tool: eventId (required) and calendarId (optional, defaults to 'primary').
    export const getEventSchema = () =>
      z.object({
        eventId: z.string().describe("Event ID"),
        calendarId: z
          .string()
          .default("primary")
          .describe(getCalendarDescription()),
      });
  • src/index.ts:233-240 (registration)
    Registers the 'calendar-get-event' tool with the MCP server inside registerCalendarTools function, providing name, description, input schema from getEventSchema, and handler that delegates to getEvent.
    server.tool(
      "calendar-get-event",
      "Get a specific calendar event by ID",
      getEventSchema().shape,
      async (params) => {
        return await getEvent(params);
      }
    );
  • Helper function used by getEvent to format the retrieved event data into a readable Markdown string for the tool response.
    function formatEventToMarkdown(event: any): string {
      let markdown = `# ${event.summary || 'Untitled Event'}\n\n`;
      
      if (event.description) markdown += `${event.description}\n\n`;
      
      const startDate = event.start?.dateTime ? new Date(event.start.dateTime) : null;
      const endDate = event.end?.dateTime ? new Date(event.end.dateTime) : null;
      
      if (startDate) {
        markdown += `Start: ${startDate.toLocaleString()}  \n`;
      }
      if (endDate) {
        markdown += `End: ${endDate.toLocaleString()}  \n`;
      }
      
      if (event.location) markdown += `Location: ${event.location}  \n`;
      
      if (event.attendees && event.attendees.length > 0) {
        markdown += `Attendees: ${event.attendees.map((a: any) => {
          let attendee = a.email || a;
          if (a.responseStatus) {
            const status = a.responseStatus === 'accepted' ? '✅' : 
                         a.responseStatus === 'declined' ? '❌' : 
                         a.responseStatus === 'tentative' ? '❓' : '⏳';
            attendee += ` ${status}`;
          }
          return attendee;
        }).join(', ')}  \n`;
      }
      
      if (event.htmlLink) markdown += `Calendar Link: [View Event](${event.htmlLink})  \n`;
      if (event.id) markdown += `Event ID: \`${event.id}\`  \n`;
      
      return markdown;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.0.0
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('Get') but doesn't mention whether this is a read-only operation, what permissions are required, error handling (e.g., for invalid IDs), or response format. This leaves significant gaps for a tool that likely interacts with user data.

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

Conciseness5/5

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

The description is a single, direct sentence with zero wasted words. It front-loads the core action and resource, making it easy to parse quickly. Every word earns its place by conveying essential information without redundancy.

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?

Given the lack of annotations and output schema, the description is incomplete for a data retrieval tool. It doesn't explain what the tool returns (e.g., event details, error responses) or behavioral aspects like authentication needs. For a tool with two parameters and no structured output documentation, this leaves the agent under-informed.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema fully documents both parameters (eventId and calendarId). The description adds no additional meaning beyond implying 'eventId' is required for retrieval, which is already clear from the schema's required field. This meets the baseline for high schema coverage.

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 ('Get') and resource ('specific calendar event by ID'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'calendar-list-events' or 'calendar-update-event' beyond the implied specificity of retrieving a single event.

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?

The description provides no guidance on when to use this tool versus alternatives like 'calendar-list-events' for multiple events or 'calendar-update-event' for modifications. It lacks context about prerequisites (e.g., needing an event ID) or exclusions, offering only basic functional information.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.