Skip to main content
Glama
recursechat

Apple Shortcuts Server

by recursechat

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
NameRequiredDescriptionDefault
inputNoOptional input to pass to the shortcut
nameYesName of the shortcut to run

Implementation Reference

  • 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, }; } }
  • 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 ?? {}) );

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/recursechat/mcp-server-apple-shortcuts'

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