Skip to main content
Glama

deleteCalendar

Remove a specific calendar from Apple Calendar using the calendar ID. This tool enables precise management of calendar data on macOS through the MCP Apple Calendars server.

Input Schema

NameRequiredDescriptionDefault
calendarIdYes

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "calendarId": { "type": "string" } }, "required": [ "calendarId" ], "type": "object" }

Implementation Reference

  • MCP tool handler function for 'deleteCalendar' that invokes calendars.deleteCalendar and returns a formatted MCP response.
    async ({ calendarId }) => { try { const success = await calendars.deleteCalendar(calendarId); return { content: [{ type: "text", text: JSON.stringify({ success, message: success ? "Calendar deleted" : "Failed to delete calendar" }) }] }; } catch (error) { return { content: [{ type: "text", text: JSON.stringify({ error: "Failed to delete calendar" }) }], isError: true }; } } );
  • Zod input schema for the 'deleteCalendar' tool requiring a calendarId string.
    { calendarId: z.string()
  • src/index.ts:268-296 (registration)
    Registration of the 'deleteCalendar' MCP tool using server.tool, including name, schema, and handler.
    server.tool( "deleteCalendar", { calendarId: z.string() }, async ({ calendarId }) => { try { const success = await calendars.deleteCalendar(calendarId); return { content: [{ type: "text", text: JSON.stringify({ success, message: success ? "Calendar deleted" : "Failed to delete calendar" }) }] }; } catch (error) { return { content: [{ type: "text", text: JSON.stringify({ error: "Failed to delete calendar" }) }], isError: true }; } } );
  • Supporting function that performs the actual HTTP DELETE request to the calendar API bridge to delete the specified calendar.
    export async function deleteCalendar(calendarId: string): Promise<boolean> { try { await axios.delete(`${API_BASE_URL}/calendars/${calendarId}`); return true; } catch (error) { console.error(`Failed to delete calendar "${calendarId}":`, error); throw new Error(`Failed to delete calendar: ${error}`); } }

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

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