run_shortcut
Execute Apple Shortcuts automations by name, optionally providing input for tailored workflows, using the Apple Shortcuts Server MCP integration.
Instructions
Run a Shortcuts automation by name
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | No | Optional input to pass to the shortcut | |
| name | Yes | Name of the shortcut to run |
Implementation Reference
- src/index.ts:77-106 (handler)Handler logic for the 'run_shortcut' tool: constructs and executes a 'shortcuts run' shell command with optional input, captures stdout or error message.case "run_shortcut": { try { const command = args.input ? `shortcuts run "${args.name}" -i "${args.input}"` : `shortcuts run "${args.name}"`; console.error("MCP shortcuts: Running command:", command); const stdout = execSync(command).toString(); return { content: [ { type: "text", text: stdout || "Shortcut executed successfully", }, ], isError: false, }; } catch (error) { return { content: [ { type: "text", text: `Failed to run shortcut: ${(error as Error).message}`, }, ], isError: true, }; } }
- src/index.ts:17-31 (schema)Input schema definition for the 'run_shortcut' tool in the TOOLS array, specifying 'name' (required) and optional 'input'.{ name: "run_shortcut", description: "Run a Shortcuts automation by name", inputSchema: { type: "object", properties: { name: { type: "string", description: "Name of the shortcut to run" }, input: { type: "string", description: "Optional input to pass to the shortcut", }, }, required: ["name"], }, },
- src/index.ts:164-166 (registration)Registration of ListToolsRequestHandler which returns the TOOLS array including 'run_shortcut'.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }));
- src/index.ts:168-170 (registration)Registration of CallToolRequestHandler which dispatches to handleToolCall based on tool name, invoking the 'run_shortcut' handler.server.setRequestHandler(CallToolRequestSchema, async (request) => handleToolCall(request.params.name, request.params.arguments ?? {}) );