Skip to main content
Glama

shortcuts_run_shortcut

Execute macOS shortcuts in the background using AppleScript integration. Provide a shortcut name and optional input to automate tasks without opening the Shortcuts app.

Instructions

[Shortcuts operations] Run a shortcut with optional input. Uses Shortcuts Events to run in background without opening the app.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the shortcut to run
inputNoOptional input to provide to the shortcut

Implementation Reference

  • Handler function that generates AppleScript to run the named shortcut via Shortcuts Events app, optionally with input, and handles errors.
    script: (args) => ` try tell application "Shortcuts Events" ${args.input ? `run shortcut "${args.name}" with input "${args.input}"` : `run shortcut "${args.name}"` } end tell return "Shortcut '${args.name}' executed successfully" on error errMsg return "Failed to run shortcut: " & errMsg end try `,
  • Input schema for the tool: requires 'name' (string), optional 'input' (string).
    schema: { type: "object", properties: { name: { type: "string", description: "Name of the shortcut to run", }, input: { type: "string", description: "Optional input to provide to the shortcut", }, }, required: ["name"], },
  • src/index.ts:33-33 (registration)
    Registers the 'shortcuts' category containing the 'run_shortcut' script by adding it to the MCP server.
    server.addCategory(shortcutsCategory);
  • In the listTools handler, constructs the full tool name as '{category.name}_{script.name}', yielding 'shortcuts_run_shortcut'.
    name: `${category.name}_${script.name}`, // Changed from dot to underscore
  • In the callTool handler, parses the tool name 'shortcuts_run_shortcut' by splitting on '_' to extract category 'shortcuts' and script 'run_shortcut'.
    const [categoryName, ...scriptNameParts] = toolName.split("_"); const scriptName = scriptNameParts.join("_"); // Rejoin in case script name has underscores

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/joshrutkowski/applescript-mcp'

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