list_shortcuts
Retrieve a complete list of available shortcuts from the Apple Shortcuts Server for streamlined workflow management and automation.
Instructions
List all available shortcuts
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:63-75 (handler)The switch case in handleToolCall that implements the logic for the 'list_shortcuts' tool. It calls updateShortcutsList() and returns the list of available shortcuts as text content.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)The schema definition for the 'list_shortcuts' tool in the TOOLS array, specifying name, description, and empty input schema.{ name: "list_shortcuts", description: "List all available shortcuts", inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:164-166 (registration)Handler for ListToolsRequestSchema that registers the list of tools, including 'list_shortcuts', by returning the TOOLS array.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }));
- src/index.ts:45-56 (helper)Helper function that populates the global availableShortcuts array by running the 'shortcuts list' command and parsing its output.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 = []; } }