/** * Calendar module for Outlook MCP server */ const handleListEvents = require('./list'); const handleDeclineEvent = require('./decline'); const handleAcceptEvent = require('./accept'); const handleCreateEvent = require('./create'); const handleCancelEvent = require('./cancel'); const handleDeleteEvent = require('./delete'); // Calendar tool definitions const calendarTools = [ { name: "list-events", description: "List calendar events. Defaults to upcoming events from now. Use startDate/endDate to query a specific date range including past events (e.g. to reconstruct what was scheduled on a given day).", inputSchema: { type: "object", properties: { count: { anyOf: [{ type: "number" }, { type: "string" }], description: "Number of events to retrieve (default: 10, max: 500). WARNING: Large counts may consume significant context tokens." }, startDate: { type: "string", description: "Start of date range (ISO 'YYYY-MM-DD' or full ISO 8601 datetime). Defaults to now if omitted." }, endDate: { type: "string", description: "End of date range (ISO 'YYYY-MM-DD' or full ISO 8601 datetime). To query a single day set startDate and endDate to the same date." } }, required: [] }, handler: handleListEvents }, { name: "accept-event", description: "Accepts a calendar event", inputSchema: { type: "object", properties: { eventId: { type: "string", description: "The ID of the event to accept" }, comment: { type: "string", description: "Optional comment for accepting the event" } }, required: ["eventId"] }, handler: handleAcceptEvent }, { name: "decline-event", description: "Declines a calendar event", inputSchema: { type: "object", properties: { eventId: { type: "string", description: "The ID of the event to decline" }, comment: { type: "string", description: "Optional comment for declining the event" } }, required: ["eventId"] }, handler: handleDeclineEvent }, { name: "create-event", description: "Creates a new calendar event", inputSchema: { type: "object", properties: { subject: { type: "string", description: "The subject of the event" }, start: { type: "string", description: "The start time of the event in ISO 8601 format" }, end: { type: "string", description: "The end time of the event in ISO 8601 format" }, attendees: { type: "array", items: { type: "string" }, description: "List of attendee email addresses" }, body: { type: "string", description: "Optional body content for the event" } }, required: ["subject", "start", "end"] }, handler: handleCreateEvent }, { name: "cancel-event", description: "Cancels a calendar event", inputSchema: { type: "object", properties: { eventId: { type: "string", description: "The ID of the event to cancel" }, comment: { type: "string", description: "Optional comment for cancelling the event" } }, required: ["eventId"] }, handler: handleCancelEvent }, { name: "delete-event", description: "Deletes a calendar event", inputSchema: { type: "object", properties: { eventId: { type: "string", description: "The ID of the event to delete" } }, required: ["eventId"] }, handler: handleDeleteEvent } ]; module.exports = { calendarTools, handleListEvents, handleAcceptEvent, handleDeclineEvent, handleCreateEvent, handleCancelEvent, handleDeleteEvent };