update_event
Modify existing calendar events by updating details like subject, date, time, location, or description directly in Microsoft Outlook, ensuring changes are managed locally for privacy.
Instructions
Update an existing calendar event
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | New event description/body (optional) | |
| calendar | No | Calendar name (optional) | |
| endDate | No | New end date in MM/DD/YYYY format (optional) | |
| endTime | No | New end time in HH:MM AM/PM format (optional) | |
| eventId | Yes | Event ID to update | |
| location | No | New event location (optional) | |
| startDate | No | New start date in MM/DD/YYYY format (optional) | |
| startTime | No | New start time in HH:MM AM/PM format (optional) | |
| subject | No | New event subject/title (optional) |
Implementation Reference
- src/outlookTools.js:336-360 (handler)The specific handler function for the 'update_event' MCP tool. It extracts parameters, calls the updateEvent helper function from scriptRunner.js, and formats the response as MCP content with error handling.handler: async ({ eventId, subject, startDate, startTime, endDate, endTime, location, body, calendar }) => { try { const result = await updateEvent(eventId, subject, startDate, startTime, endDate, endTime, location, body, calendar); return { content: [ { type: 'text', text: result.success ? `Event updated successfully` : `Failed to update event` } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error updating event: ${error.message}` } ], isError: true }; } }
- src/outlookTools.js:294-335 (schema)Input schema for the 'update_event' tool, defining all parameters with types, descriptions, and required fields.inputSchema: { type: 'object', properties: { eventId: { type: 'string', description: 'Event ID to update' }, subject: { type: 'string', description: 'New event subject/title (optional)' }, startDate: { type: 'string', description: 'New start date in MM/DD/YYYY format (optional)' }, startTime: { type: 'string', description: 'New start time in HH:MM AM/PM format (optional)' }, endDate: { type: 'string', description: 'New end date in MM/DD/YYYY format (optional)' }, endTime: { type: 'string', description: 'New end time in HH:MM AM/PM format (optional)' }, location: { type: 'string', description: 'New event location (optional)' }, body: { type: 'string', description: 'New event description/body (optional)' }, calendar: { type: 'string', description: 'Calendar name (optional)' } }, required: ['eventId'] },
- src/index.js:34-39 (registration)Registers all Outlook tools, including 'update_event', by calling defineOutlookTools() and loading them into the MCP server's tool registry.// Define the tools this.tools = defineOutlookTools(); // Set up request handlers this.setupToolHandlers();
- src/scriptRunner.js:142-154 (helper)Helper function that executes the VBScript 'updateEvent.vbs' with the provided event update parameters using the general executeScript utility.export async function updateEvent(eventId, subject, startDate, startTime, endDate, endTime, location, body, calendar) { return executeScript('updateEvent', { eventId, subject, startDate, startTime, endDate, endTime, location, body, calendar }); }
- src/index.js:66-95 (registration)MCP server request handler for calling any tool (including 'update_event') by looking up in the tool registry and invoking its handler.this.server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; // Find the requested tool const tool = this.tools[name]; if (!tool) { throw new McpError( ErrorCode.MethodNotFound, `Tool not found: ${name}` ); } try { // Call the tool handler return await tool.handler(args); } catch (error) { console.error(`Error executing tool ${name}:`, error); return { content: [ { type: 'text', text: `Error executing tool ${name}: ${error.message}`, }, ], isError: true, }; } });