list_shortcuts
Enable quick access by listing all available Siri shortcuts on macOS through the MCP Server, helping users identify and manage shortcuts efficiently.
Instructions
List all available Siri shortcuts
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- shortcuts.ts:87-141 (handler)Handler function that lists all available Siri shortcuts by executing 'shortcuts list --show-identifiers', parsing the output, populating shortcut maps, and returning the list.const listShortcuts = async (): Promise<ToolResult> => { return new Promise((resolve, reject) => { exec("shortcuts list --show-identifiers", (error, stdout, stderr) => { if (error) { reject( new McpError( ErrorCode.InternalError, `Failed to list shortcuts: ${error.message}`, ), ); return; } if (stderr) { reject( new McpError( ErrorCode.InternalError, `Error listing shortcuts: ${stderr}`, ), ); return; } // Parse output with identifiers format: "Name (UUID)" const shortcuts = stdout .split("\n") .filter((line) => line.trim()) .map((line) => { const trimmed = line.trim(); // Extract name and identifier if present const match = trimmed.match(/^(.+?)\s*\(([A-F0-9-]+)\)$/); if (match) { return { name: match[1].trim(), identifier: match[2] }; } return { name: trimmed }; }); // Update the shortcut map with unique sanitized names const existingSanitizedNames = new Set<string>(); shortcuts.forEach((shortcut) => { const uniqueSanitizedName = generateUniqueSanitizedName(shortcut.name, existingSanitizedNames); shortcutMap.set(shortcut.name, uniqueSanitizedName); existingSanitizedNames.add(uniqueSanitizedName); // Store identifier if present if ('identifier' in shortcut && shortcut.identifier) { shortcutIdentifierMap.set(shortcut.name, shortcut.identifier); } }); resolve({ shortcuts }); }); }); };
- shortcuts.ts:26-26 (schema)Input schema for list_shortcuts tool (empty object since no parameters required).const ListShortcutsSchema = z.object({}).strict();
- shortcuts.ts:294-298 (registration)Registration of the list_shortcuts tool in the base tools array returned by getBaseTools().name: ToolName.LIST_SHORTCUTS, description: "List all available Siri shortcuts", inputSchema: zodToJsonSchema(ListShortcutsSchema) as ToolInput, run: listShortcuts, },
- shortcuts.ts:46-50 (helper)Enum defining the tool name constant LIST_SHORTCUTS = "list_shortcuts" used in registration and dispatching.enum ToolName { LIST_SHORTCUTS = "list_shortcuts", OPEN_SHORTCUT = "open_shortcut", RUN_SHORTCUT = "run_shortcut", }
- shortcuts.ts:388-389 (registration)Dispatch/execution case in the CallToolRequest handler switch statement.case ToolName.LIST_SHORTCUTS: result = await listShortcuts();