list-calendars
Retrieve all available macOS calendars through direct integration with the Calendar application, enabling event management without OAuth setup.
Instructions
列出所有macOS日历
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- macos-calendar-mcp-sdk.js:298-315 (handler)The handler function that implements the list-calendars tool by executing AppleScript to retrieve and format the list of macOS calendars.async listCalendars() { try { const script = `tell application "Calendar" to get name of calendars`; const result = execSync(`osascript -e '${script}'`, { encoding: 'utf8' }); const calendars = result.trim().split(', '); return { content: [ { type: 'text', text: `📅 可用日历 (${calendars.length}个):\n${calendars.map(cal => `• ${cal}`).join('\n')}`, }, ], }; } catch (error) { throw new Error(`获取日历列表失败: ${error.message}`); } }
- macos-calendar-mcp-v2.js:246-261 (handler)The handler function that implements the list-calendars tool by executing AppleScript to retrieve and format the list of macOS calendars.listCalendars() { try { const script = `tell application "Calendar" to get name of calendars`; const result = execSync(`osascript -e '${script}'`, { encoding: 'utf8' }); const calendars = result.trim().split(', '); return { content: [{ type: "text", text: `📅 可用日历 (${calendars.length}个):\n${calendars.map(cal => `• ${cal}`).join('\n')}` }] }; } catch (error) { throw new Error(`获取日历列表失败: ${error.message}`); } }
- macos-calendar-mcp.js:142-157 (handler)The handler function that implements the list-calendars tool by executing AppleScript to retrieve and format the list of macOS calendars.listCalendars() { try { const script = `tell application "Calendar" to get name of calendars`; const result = execSync(`osascript -e '${script}'`, { encoding: 'utf8' }); const calendars = result.trim().split(', '); return { content: [{ type: "text", text: `📅 可用日历 (${calendars.length}个):\n${calendars.map(cal => `• ${cal}`).join('\n')}` }] }; } catch (error) { throw new Error(`获取日历列表失败: ${error.message}`); } }
- macos-calendar-mcp-sdk.js:34-40 (schema)Input schema definition for the list-calendars tool (no parameters required).name: 'list-calendars', description: '列出所有macOS日历', inputSchema: { type: 'object', properties: {}, additionalProperties: false, },
- macos-calendar-mcp-sdk.js:234-235 (registration)Registration of the list-calendars handler in the tool call switch statement.case 'list-calendars': return await this.listCalendars();