Skip to main content
Glama

google_calendar_create_event

Add new events to Google Calendar by specifying title, start/end time, location, description, attendees, and recurrence rules using this integration tool.

Instructions

Create a new event in Google Calendar

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
attendeesNoList of email addresses to invite
calendarIdNoOptional: ID of calendar to use (defaults to primary if not specified)
colorIdNoColor identifier (1-11) for the event
descriptionNoDetailed description of the event
endYesEnd time of the event in ISO 8601 format (e.g. 2025-04-02T11:00:00-07:00)
locationNoPhysical location or address
recurrenceNoRFC5545 recurrence rule (e.g., 'RRULE:FREQ=WEEKLY;COUNT=10')
startYesStart time of the event in ISO 8601 format (e.g. 2025-04-02T10:00:00-07:00)
summaryYesThe title/summary of the event

Implementation Reference

  • The main handler function that executes the tool: validates arguments using isCreateEventArgs, destructures parameters, performs additional checks, calls the underlying GoogleCalendar.createEvent method, and returns a formatted response.
    export async function handleCalendarCreateEvent(
      args: any,
      googleCalendarInstance: GoogleCalendar
    ) {
      if (!isCreateEventArgs(args)) {
        throw new Error("Invalid arguments for google_calendar_create_event");
      }
    
      const {
        summary,
        start,
        end,
        calendarId,
        description,
        location,
        colorId,
        attendees,
        recurrence,
      } = args;
    
      if (!summary || !start || !end) throw new Error("Missing required arguments");
    
      const result = await googleCalendarInstance.createEvent(
        summary,
        start,
        end,
        calendarId,
        description,
        location,
        colorId,
        attendees,
        recurrence
      );
    
      return {
        content: [{ type: "text", text: result }],
        isError: false,
      };
    }
  • Input schema definition for the google_calendar_create_event tool, including name, description, properties, and required fields.
    export const CREATE_EVENT_TOOL: Tool = {
      name: "google_calendar_create_event",
      description: "Create a new event in Google Calendar",
      inputSchema: {
        type: "object",
        properties: {
          summary: {
            type: "string",
            description: "The title/summary of the event",
          },
          description: {
            type: "string",
            description: "Detailed description of the event",
          },
          location: {
            type: "string",
            description: "Physical location or address",
          },
          start: {
            type: "string",
            description:
              "Start time of the event in ISO 8601 format (e.g. 2025-04-02T10:00:00-07:00)",
          },
          end: {
            type: "string",
            description:
              "End time of the event in ISO 8601 format (e.g. 2025-04-02T11:00:00-07:00)",
          },
          colorId: {
            type: "string",
            description: "Color identifier (1-11) for the event",
          },
          attendees: {
            type: "array",
            items: { type: "string" },
            description: "List of email addresses to invite",
          },
          recurrence: {
            type: "string",
            description:
              "RFC5545 recurrence rule (e.g., 'RRULE:FREQ=WEEKLY;COUNT=10')",
          },
          calendarId: {
            type: "string",
            description:
              "Optional: ID of calendar to use (defaults to primary if not specified)",
          },
        },
        required: ["summary", "start", "end"],
      },
    };
  • Core implementation in GoogleCalendar class: constructs the event request body from parameters, calls Google Calendar API events.insert, handles optional fields like attendees and recurrence, and returns success message with event ID.
    async createEvent(
      summary: string,
      start: string,
      end: string,
      calendarId?: string,
      description?: string,
      location?: string,
      colorId?: string,
      attendees?: string[],
      recurrence?: string
    ) {
      try {
        const targetCalendarId = calendarId || this.defaultCalendarId;
    
        // Build the request body with required fields
        const requestBody: any = {
          summary,
          start: { dateTime: start },
          end: { dateTime: end },
        };
    
        // Add optional fields if provided
        if (description) requestBody.description = description;
        if (location) requestBody.location = location;
        if (colorId) requestBody.colorId = colorId;
    
        // Format attendees if provided
        if (attendees && attendees.length > 0) {
          requestBody.attendees = attendees.map((email) => ({ email }));
        }
    
        // Add recurrence rule if provided
        if (recurrence) {
          requestBody.recurrence = [recurrence];
        }
    
        const event = await this.calendar.events.insert({
          calendarId: targetCalendarId,
          requestBody,
          sendUpdates: attendees && attendees.length > 0 ? "all" : "none",
        });
    
        return `Event "${summary}" created with ID: ${event.data.id} in calendar: ${targetCalendarId}`;
      } catch (error) {
        throw new Error(
          `Failed to create event: ${
            error instanceof Error ? error.message : String(error)
          }`
        );
      }
    }
  • Type guard function for validating input arguments to the create event handler.
    export function isCreateEventArgs(args: any): args is {
      summary: string;
      start: string;
      end: string;
      calendarId?: string;
      description?: string;
      location?: string;
      colorId?: string;
      attendees?: string[];
      recurrence?: string;
    } {
      return (
        args &&
        typeof args.summary === "string" &&
        typeof args.start === "string" &&
        typeof args.end === "string" &&
        (args.calendarId === undefined || typeof args.calendarId === "string") &&
        (args.description === undefined || typeof args.description === "string") &&
        (args.location === undefined || typeof args.location === "string") &&
        (args.colorId === undefined || typeof args.colorId === "string") &&
        (args.recurrence === undefined || typeof args.recurrence === "string") &&
        (args.attendees === undefined || Array.isArray(args.attendees))
      );
    }
  • tools/index.ts:1-25 (registration)
    Central registration file that aggregates all tools including calendarTools (which contains google_calendar_create_event) into a single tools array for MCP registration.
    import { oauthTools } from "./oauth/index";
    import { calendarTools } from "./calendar/index";
    import { gmailTools } from "./gmail/index";
    import { driveTools } from "./drive/index";
    import { tasksTools } from "./tasks/index";
    
    const tools = [
      // OAuth tools
      ...oauthTools,
    
      // Calendar tools
      ...calendarTools,
    
      // Gmail tools
      ...gmailTools,
    
      // Google Drive tools
      ...driveTools,
    
      // Google Tasks tools
      ...tasksTools,
    ];
    
    export default tools;
Behavior1/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers almost none. It doesn't mention that this is a write/mutation operation (implied but not stated), what permissions are required, whether events are created immediately or scheduled, error conditions, or what happens on success/failure. For a creation tool with zero annotation coverage, this is critically inadequate.

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, efficient sentence that states the core purpose without any fluff. It's appropriately front-loaded and wastes no words, making it easy to parse quickly.

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 complexity of a 9-parameter creation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., event ID, success confirmation), error handling, or behavioral nuances. The agent lacks critical context needed to use this tool effectively beyond basic parameter passing.

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?

The schema description coverage is 100%, with all 9 parameters well-documented in the input schema itself (e.g., format requirements like ISO 8601 for dates, RFC5545 for recurrence). The description adds no additional parameter information beyond what's already in the schema, so it meets the baseline of 3 but doesn't compensate or enhance understanding.

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 action ('Create') and resource ('new event in Google Calendar'), making the purpose immediately understandable. It distinguishes this tool from deletion, update, and retrieval tools in the sibling list. However, it doesn't specify what distinguishes it from similar creation tools in other Google services (like google_drive_create_file), so it's not a perfect 5.

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. There's no mention of prerequisites (like authentication), when to choose this over google_calendar_update_event for modifications, or any context about typical use cases. The agent must infer usage from the tool name alone.

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

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

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