deleteCalendarEvent
Remove specific events from Apple Calendar by providing the calendar ID and event ID. Designed for use with the MCP Apple Calendars server to manage macOS calendar data programmatically.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| calendarId | Yes | ||
| eventId | Yes |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"calendarId": {
"type": "string"
},
"eventId": {
"type": "string"
}
},
"required": [
"calendarId",
"eventId"
],
"type": "object"
}
Implementation Reference
- src/calendars.ts:221-229 (handler)Core implementation of deleteCalendarEvent that sends a DELETE request to the Calendar API Bridge endpoint.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}`); } }
- src/index.ts:236-265 (registration)Registers the deleteCalendarEvent MCP tool, defining its schema and providing a wrapper handler that delegates to the core implementation and formats the MCP response.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 }; } } );
- src/index.ts:238-241 (schema)Zod input schema requiring calendarId and eventId as strings.{ calendarId: z.string(), eventId: z.string() },