Skip to main content
Glama

calendar_events_delete

Delete calendar events from Google Calendar by specifying calendar and event IDs. Remove scheduled meetings or appointments from your Google Workspace calendar.

Instructions

Delete a calendar event.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
calendarIdYesCalendar ID
eventIdYesEvent ID to delete

Implementation Reference

  • Tool definition for calendar_events_delete specifying name, description, gws CLI command (['calendar', 'events', 'delete']), and required parameters (calendarId, eventId)
    {
      name: "calendar_events_delete",
      description: "Delete a calendar event.",
      command: ["calendar", "events", "delete"],
      params: [
        { name: "calendarId", description: "Calendar ID", type: "string", required: true },
        { name: "eventId", description: "Event ID to delete", type: "string", required: true },
      ],
    },
  • The executeGws function is the main handler that executes any tool including calendar_events_delete. It builds CLI args, spawns the gws process, handles errors, and returns results.
    export async function executeGws(
      tool: ToolDef,
      args: Record<string, unknown>,
      gwsBinary: string,
    ): Promise<ExecResult> {
      const cliArgs = buildArgs(tool, args);
    
      console.error(`[gws-mcp] Executing: ${gwsBinary} ${cliArgs.join(" ")}`);
    
      try {
        const { stdout, stderr } = await spawnGwsRaw(gwsBinary, cliArgs);
    
        if (stderr) {
          console.error(`[gws-mcp] stderr: ${stderr}`);
        }
    
        return { success: true, output: stdout || "(empty response)" };
      } catch (err: unknown) {
        const error = err as { message?: string };
        let message = error.message || "Unknown error";
    
        // Enhance Drive 404 errors with actionable hints
        if (message.includes("404") && message.includes("not found") && tool.command[0] === "drive") {
          message += "\n\nHint: If this file is in a shared drive, ensure supportsAllDrives is set (this should be automatic). Check that the file ID is correct and the authenticated account has access.";
        }
    
        console.error(`[gws-mcp] Error: ${message}`);
        return { success: false, output: "", error: message };
      }
    }
  • src/index.ts:155-178 (registration)
    Registration loop that iterates through all tool definitions and registers each with the MCP server using server.tool(), including the handler callback that invokes executeGws
    // Register each tool
    for (const tool of tools) {
      const schema = buildZodSchema(tool);
    
      server.tool(
        tool.name,
        tool.description,
        schema,
        async (args) => {
          const result = await executeGws(tool, args as Record<string, unknown>, gwsBinary);
    
          if (result.success) {
            return {
              content: [{ type: "text" as const, text: result.output || "(empty response)" }],
            };
          } else {
            return {
              content: [{ type: "text" as const, text: `Error: ${result.error}` }],
              isError: true,
            };
          }
        },
      );
    }
  • The buildArgs function constructs CLI arguments from tool definition and user args, handling params, bodyParams, and file uploads with proper escaping for security
    function buildArgs(
      tool: ToolDef,
      args: Record<string, unknown>,
    ): string[] {
      const cliArgs = [...tool.command];
    
      // Collect --params (query/path parameters)
      // Start with defaults (e.g. supportsAllDrives), then overlay caller values
      const params: Record<string, unknown> = { ...(tool.defaultParams || {}) };
      for (const p of tool.params) {
        if (args[p.name] !== undefined) {
          params[p.name] = args[p.name];
        }
      }
      if (Object.keys(params).length > 0) {
        cliArgs.push("--params", escapeJsonArg(JSON.stringify(params)));
      }
    
      // Collect --json (request body)
      if (tool.bodyParams && tool.bodyParams.length > 0) {
        const body: Record<string, unknown> = {};
        for (const p of tool.bodyParams) {
          if (args[p.name] !== undefined) {
            let val = args[p.name];
            if (typeof val === "string") {
              try {
                const parsed = JSON.parse(val);
                if (typeof parsed === "object") {
                  val = parsed;
                }
              } catch {
                // Keep as string
              }
            }
            body[p.name] = val;
          }
        }
        if (Object.keys(body).length > 0) {
          cliArgs.push("--json", escapeJsonArg(JSON.stringify(body)));
        }
      }
    
      // File upload — validate path before passing to CLI
      if (tool.supportsUpload && args.uploadPath) {
        const safePath = sanitizeUploadPath(String(args.uploadPath));
        if (process.platform === "win32") {
          cliArgs.push("--upload", escapeForCmd(safePath));
        } else {
          cliArgs.push("--upload", safePath);
        }
      }
    
      return cliArgs;
    }
  • The buildZodSchema function generates Zod validation schemas from tool parameter definitions, converting ParamDef types to Zod types with optional/required handling
    function buildZodSchema(tool: ToolDef): Record<string, z.ZodTypeAny> {
      const shape: Record<string, z.ZodTypeAny> = {};
    
      const allParams = [...tool.params, ...(tool.bodyParams || [])];
    
      for (const p of allParams) {
        let field: z.ZodTypeAny;
        switch (p.type) {
          case "number":
            field = z.number().describe(p.description);
            break;
          case "boolean":
            field = z.boolean().describe(p.description);
            break;
          default:
            field = z.string().describe(p.description);
        }
    
        if (!p.required) {
          field = field.optional();
        }
    
        shape[p.name] = field;
      }
    
      // Add optional uploadPath for tools that support file upload
      if (tool.supportsUpload) {
        shape.uploadPath = z.string().describe("Local file path to upload").optional();
      }
    
      return shape;
    }
Behavior2/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. It states the action ('Delete') but doesn't describe critical traits: whether deletion is permanent or reversible, what permissions are required, if it affects recurring events, or what happens on success/failure. This is inadequate for a destructive operation.

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 with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly without unnecessary elaboration.

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?

For a destructive tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral implications (e.g., permanence, error handling), usage context, and expected outcomes, leaving significant gaps for an AI agent to understand the tool fully.

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%, with both parameters ('calendarId', 'eventId') documented in the schema. The description adds no additional meaning beyond implying these IDs are needed for deletion, so it meets the baseline of 3 where the schema does the heavy lifting.

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 ('Delete') and resource ('a calendar event'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'calendar_events_update' or 'drive_files_delete', which would require mentioning it's specifically for calendar events rather than other resources.

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. It doesn't mention prerequisites (e.g., needing valid calendar and event IDs), when not to use it (e.g., for bulk deletions), or refer to sibling tools like 'calendar_events_update' for modifications instead of deletion.

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

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/conorbronsdon/gws-mcp-server'

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