get_calendars
Retrieve and list available Microsoft Outlook calendars on Windows systems directly through the Outlook Calendar MCP server, ensuring local data privacy and efficient calendar management.
Instructions
List available calendars
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/outlookTools.js:371-393 (handler)Handler for the 'get_calendars' MCP tool: calls the getCalendars() helper, returns formatted JSON response or error.handler: async () => { try { const calendars = await getCalendars(); return { content: [ { type: 'text', text: JSON.stringify(calendars, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error getting calendars: ${error.message}` } ], isError: true }; } }
- src/outlookTools.js:367-370 (schema)Input schema for 'get_calendars' tool (no parameters required).inputSchema: { type: 'object', properties: {} },
- src/index.js:34-36 (registration)Loads tool definitions from outlookTools.js into the MCP server's tool registry.// Define the tools this.tools = defineOutlookTools();
- src/index.js:67-95 (registration)MCP CallToolRequestSchema handler that dispatches tool calls to the appropriate tool.handler based on name (registers all tools dynamically).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, }; } });
- src/scriptRunner.js:156-162 (helper)Helper function that executes the 'getCalendars.vbs' script to retrieve calendars./** * Lists available calendars * @returns {Promise<Array>} - Promise that resolves with an array of calendars */ export async function getCalendars() { return executeScript('getCalendars'); }