Skip to main content
Glama

deleteCalendarEvent

Remove calendar events from Apple Calendar by specifying calendar and event IDs to manage schedules and clean up outdated appointments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
calendarIdYes
eventIdYes

Implementation Reference

  • The MCP tool handler that executes the tool logic: calls the helper, processes success/failure, and returns formatted MCP response.
    async ({ calendarId, eventId }) => { try { const success = await calendars.deleteCalendarEvent(calendarId, eventId); return { content: [{ type: "text", text: JSON.stringify({ success, message: success ? "Event deleted" : "Failed to delete event" }) }] }; } catch (error) { return { content: [{ type: "text", text: JSON.stringify({ error: "Failed to delete event" }) }], isError: true }; } }
  • Input schema using Zod for validating calendarId and eventId parameters.
    { calendarId: z.string(), eventId: z.string() },
  • src/index.ts:236-265 (registration)
    Registration of the deleteCalendarEvent tool with MCP server, including schema and handler.
    server.tool( "deleteCalendarEvent", { calendarId: z.string(), eventId: z.string() }, async ({ calendarId, eventId }) => { try { const success = await calendars.deleteCalendarEvent(calendarId, eventId); return { content: [{ type: "text", text: JSON.stringify({ success, message: success ? "Event deleted" : "Failed to delete event" }) }] }; } catch (error) { return { content: [{ type: "text", text: JSON.stringify({ error: "Failed to delete event" }) }], isError: true }; } } );
  • Supporting helper function that performs the actual HTTP DELETE request to the Calendar API Bridge.
    export async function deleteCalendarEvent(calendarId: string, eventId: string): Promise<boolean> { try { await axios.delete(`${API_BASE_URL}/calendars/${calendarId}/events/${eventId}`); return true; } catch (error) { console.error(`Failed to delete event "${eventId}" from calendar "${calendarId}":`, error); throw new Error(`Failed to delete calendar event: ${error}`); } }

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/shadowfax92/apple-calendar-mcp'

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