find_free_slots
Identify open time slots in your Outlook Calendar between specified dates with customizable work hours and duration, ensuring efficient scheduling without data leaving your system.
Instructions
Find available time slots in the calendar
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| calendar | No | Calendar name (optional) | |
| duration | No | Duration in minutes (optional, defaults to 30) | |
| endDate | No | End date in MM/DD/YYYY format (optional, defaults to 7 days from start date) | |
| startDate | Yes | Start date in MM/DD/YYYY format | |
| workDayEnd | No | Work day end hour (0-23) (optional, defaults to 17) | |
| workDayStart | No | Work day start hour (0-23) (optional, defaults to 9) |
Implementation Reference
- src/outlookTools.js:177-198 (handler)The MCP handler function for the 'find_free_slots' tool. It calls findFreeSlots from scriptRunner.js, formats the result as MCP content, and handles errors.handler: async ({ startDate, endDate, duration, workDayStart, workDayEnd, calendar }) => { try { const freeSlots = await findFreeSlots(startDate, endDate, duration, workDayStart, workDayEnd, calendar); return { content: [ { type: 'text', text: JSON.stringify(freeSlots, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error finding free slots: ${error.message}` } ], isError: true }; }
- src/outlookTools.js:147-176 (schema)Input schema defining the parameters and validation for the 'find_free_slots' tool.inputSchema: { type: 'object', properties: { startDate: { type: 'string', description: 'Start date in MM/DD/YYYY format' }, endDate: { type: 'string', description: 'End date in MM/DD/YYYY format (optional, defaults to 7 days from start date)' }, duration: { type: 'number', description: 'Duration in minutes (optional, defaults to 30)' }, workDayStart: { type: 'number', description: 'Work day start hour (0-23) (optional, defaults to 9)' }, workDayEnd: { type: 'number', description: 'Work day end hour (0-23) (optional, defaults to 17)' }, calendar: { type: 'string', description: 'Calendar name (optional)' } }, required: ['startDate'] },
- src/scriptRunner.js:98-107 (helper)Helper function findFreeSlots that executes the underlying VBScript 'findFreeSlots.vbs' via executeScript.export async function findFreeSlots(startDate, endDate, duration, workDayStart, workDayEnd, calendar) { return executeScript('findFreeSlots', { startDate, endDate, duration, workDayStart, workDayEnd, calendar }); }
- src/index.js:35-36 (registration)Registration of all tools including 'find_free_slots' by calling defineOutlookTools() and storing in this.tools for use in MCP request handlers.this.tools = defineOutlookTools();