Skip to main content
Glama
dvcrn

Siri Shortcuts MCP Server

by dvcrn

run_shortcut

Execute a Siri Shortcut by name or UUID using the Siri Shortcuts MCP Server, with optional input and output parameters for dynamic interaction.

Instructions

Run a shortcut by name or identifier (UUID) with optional input and output parameters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputNoThe input to pass to the shortcut. Can be text, or a filepath
nameYesThe name or identifier (UUID) of the shortcut to run

Implementation Reference

  • The handler function that executes the 'shortcuts run' command with the provided shortcut name and optional input (handling both text and file inputs).
    const runShortcut = async (params: RunShortcutInput): Promise<ToolResult> => {
      return new Promise((resolve, reject) => {
        let command = `shortcuts run '${params.name}'`;
    
        const args = ["run", `'${params.name}'`];
    
        const input = params.input || " ";
    
        if (input.includes("/")) {
          if (!fs.existsSync(input)) {
            throw new McpError(
              ErrorCode.InvalidParams,
              `Input file does not exist: ${input}`,
            );
          }
          args.push("--input-path");
          args.push(`'${input}'`);
        } else {
          // Create temp file with content
          const tmpPath = path.join("/tmp", `shortcut-input-${Date.now()}`);
          fs.writeFileSync(tmpPath, input);
          args.push("--input-path");
          args.push(`'${tmpPath}'`);
        }
    
        args.push("|");
        args.push("cat");
    
        console.error("Running command: shortcuts", args.join(" "));
        exec(`shortcuts ${args.join(" ")}`, (error, stdout, stderr) => {
          console.error("Run");
          console.error("Error:", error);
          console.error("Stdout:", stdout);
          console.error("Stderr:", stderr);
    
          if (error) {
            reject(
              new McpError(
                ErrorCode.InternalError,
                `Failed to run shortcut: ${error.message}`,
              ),
            );
            return;
          }
    
          // If there's output, return it
          if (stdout.trim()) {
            resolve({ success: true, output: stdout.trim() });
          } else {
            resolve({ success: true, message: `Ran shortcut: ${params.name}` });
          }
        });
      });
    };
  • Zod schema for RunShortcutInput defining parameters: name (required string), input (optional string).
    const RunShortcutSchema = z
      .object({
        name: z.string().describe("The name or identifier (UUID) of the shortcut to run"),
        input: z
          .string()
          .optional()
          .describe(
            "The input to pass to the shortcut. Can be text, or a filepath",
          ),
      })
      .strict();
  • shortcuts.ts:305-310 (registration)
    Registration of the 'run_shortcut' tool in the base tools array, linking to the handler and schema.
    {
      name: ToolName.RUN_SHORTCUT,
      description: runShortcutDescription,
      inputSchema: zodToJsonSchema(RunShortcutSchema) as ToolInput,
      run: (params: any) => runShortcut(params as RunShortcutInput),
    },
  • shortcuts.ts:46-50 (registration)
    Enum defining the tool name constant RUN_SHORTCUT = 'run_shortcut' used for registration.
    enum ToolName {
      LIST_SHORTCUTS = "list_shortcuts",
      OPEN_SHORTCUT = "open_shortcut",
      RUN_SHORTCUT = "run_shortcut",
    }
  • shortcuts.ts:394-395 (registration)
    Dispatch in the MCP CallToolRequest handler for executing run_shortcut.
    case ToolName.RUN_SHORTCUT:
      result = await runShortcut(args as RunShortcutInput);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions 'optional input and output parameters' but doesn't clarify execution effects (e.g., whether it's read-only, requires permissions, has side effects, or handles errors). This is inadequate for a tool that likely performs actions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action and key details. Every word earns its place with no redundancy, making it highly concise and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a tool that performs an action ('run'), the description is incomplete. It lacks details on execution behavior, return values, error handling, or security implications, which are critical for an agent to use it correctly in context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents both parameters. The description adds no additional meaning beyond implying 'name' can be an identifier and 'input' is optional, which is already covered in the schema. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('run') and resource ('shortcut'), specifying it can be executed by name or UUID. It distinguishes from siblings like 'list_shortcuts' (listing) and 'open_shortcut' (opening), though it doesn't explicitly contrast them. The purpose is specific but lacks explicit sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'list_shortcuts' or 'open_shortcut'. The description mentions optional input and output parameters but doesn't explain contexts or prerequisites for usage, leaving the agent to infer from tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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/dvcrn/mcp-server-siri-shortcuts'

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