list_shortcuts
Discover available shortcuts to automate tasks on Apple devices. This tool provides a complete list of shortcuts for users to browse and select automation options.
Instructions
List all available shortcuts
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_shortcuts"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:63-75 (handler)The handler function for the 'list_shortcuts' tool, which updates the list of shortcuts and returns them as a text response.
case "list_shortcuts": { updateShortcutsList(); console.error("MCP shortcuts: Listing shortcuts"); return { content: [ { type: "text", text: `Available shortcuts:\n${availableShortcuts.join("\n")}`, }, ], isError: false, }; } - src/index.ts:32-39 (schema)Schema definition for the 'list_shortcuts' tool, specifying no input parameters.
{ name: "list_shortcuts", description: "List all available shortcuts", inputSchema: { type: "object", properties: {}, }, }, - src/index.ts:164-166 (registration)Registers the tool list handler, which exposes the 'list_shortcuts' tool via the TOOLS array.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, })); - src/index.ts:168-170 (registration)Registers the general tool call handler that dispatches to specific tool handlers including 'list_shortcuts'.
server.setRequestHandler(CallToolRequestSchema, async (request) => handleToolCall(request.params.name, request.params.arguments ?? {}) ); - src/index.ts:45-56 (helper)Helper function to fetch and parse the list of available shortcuts using the 'shortcuts list' command.
function updateShortcutsList() { try { const stdout = execSync("shortcuts list").toString(); availableShortcuts = stdout .split("\n") .map((line) => line.trim()) .filter((line) => line.length > 0); } catch (error) { console.error("Failed to list shortcuts:", error); availableShortcuts = []; } }