Skip to main content
Glama
mumunha

Cal.com Calendar MCP Server

by mumunha

calcom_add_appointment

Schedule new meetings or appointments in Cal.com calendar by providing event type, time details, and attendee information.

Instructions

Creates a new appointment in Cal.com calendar. Use this for scheduling new meetings or appointments. Requires event type ID, start time, end time, name, email, and optional notes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventTypeIdYesThe Cal.com event type ID
startTimeYesStart time in ISO format (YYYY-MM-DDTHH:mm:ss.sssZ)
endTimeYesEnd time in ISO format (YYYY-MM-DDTHH:mm:ss.sssZ)
nameYesAttendee's name
emailYesAttendee's email
notesNoOptional notes for the appointment

Implementation Reference

  • The core function that executes the tool logic: validates inputs indirectly via caller, checks rate limit, makes POST request to Cal.com /bookings API to create appointment, and returns success message with details.
    async function addAppointment( eventTypeId: number, startTime: string, endTime: string, name: string, email: string, notes?: string ) { checkRateLimit(); try { const response = await calComApiClient.post('/bookings', { eventTypeId, start: new Date(startTime).toISOString(), end: new Date(endTime).toISOString(), name, email, notes, }); const booking = response.data; return `Appointment created successfully! Booking ID: ${booking.id} Event Type: ${booking.eventTypeId} Start Time: ${booking.startTime} End Time: ${booking.endTime} Attendee: ${name} (${email}) ${notes ? `Notes: ${notes}` : ""}`; } catch (error: any) { if (axios.isAxiosError(error)) { throw new Error(`Failed to create appointment: ${error.response?.data?.message || error.message}`); } throw new Error(`Failed to create appointment: ${String(error)}`); } }
  • index.ts:12-48 (registration)
    Tool registration: defines name, description, and input schema. This Tool object is returned in listTools and used for dispatching.
    const ADD_APPOINTMENT_TOOL: Tool = { name: "calcom_add_appointment", description: "Creates a new appointment in Cal.com calendar. " + "Use this for scheduling new meetings or appointments. " + "Requires event type ID, start time, end time, name, email, and optional notes. ", inputSchema: { type: "object", properties: { eventTypeId: { type: "number", description: "The Cal.com event type ID" }, startTime: { type: "string", description: "Start time in ISO format (YYYY-MM-DDTHH:mm:ss.sssZ)" }, endTime: { type: "string", description: "End time in ISO format (YYYY-MM-DDTHH:mm:ss.sssZ)" }, name: { type: "string", description: "Attendee's name" }, email: { type: "string", description: "Attendee's email" }, notes: { type: "string", description: "Optional notes for the appointment", } }, required: ["eventTypeId", "startTime", "endTime", "name", "email"], }, };
  • Runtime schema validator: type guard function to check if arguments match the expected input shape before calling the handler.
    function isCalComAddAppointmentArgs(args: unknown): args is { eventTypeId: number; startTime: string; endTime: string; name: string; email: string; notes?: string; } { return ( typeof args === "object" && args !== null && "eventTypeId" in args && "startTime" in args && "endTime" in args && "name" in args && "email" in args ); }
  • Dispatch handler in CallToolRequestSchema: matches tool name, validates args using schema guard, calls addAppointment, formats response.
    case "calcom_add_appointment": { if (!isCalComAddAppointmentArgs(args)) { throw new Error("Invalid arguments for calcom_add_appointment"); } const { eventTypeId, startTime, endTime, name, email, notes } = args; const result = await addAppointment(eventTypeId, startTime, endTime, name, email, notes); return { content: [{ type: "text", text: result }], isError: false, }; }

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/mumunha/cal_dot_com_mcpserver'

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