Skip to main content
Glama

list-calendars

Retrieve and manage all calendars from the macOS Calendar application. This tool integrates directly with macOS Calendar via the MCP Server, enabling users to list calendars without OAuth setup.

Instructions

列出所有macOS日历

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "additionalProperties": false, "properties": {}, "type": "object" }

Implementation Reference

  • Core handler function for 'list-calendars' tool. Executes AppleScript via osascript to fetch calendar names from macOS Calendar app, splits the result, and returns formatted list.
    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}`); } }
  • Core handler function for 'list-calendars' tool in v2. Identical implementation to v1: uses osascript to list 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}`); } }
  • Core handler function for 'list-calendars' in MCP SDK version. Async wrapper with identical AppleScript logic for listing 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}`); } }
  • Input schema definition for the 'list-calendars' tool, specifying no required parameters.
    { name: "list-calendars", description: "列出所有macOS日历", inputSchema: { type: "object", properties: {}, additionalProperties: false } },
  • Tool dispatch registration in the main callTool switch statement.
    case "list-calendars": return this.listCalendars();

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/xybstone/macos-calendar-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server