Skip to main content
Glama

shortcuts_list_shortcuts

Retrieve available macOS shortcuts through AppleScript integration, optionally limiting results for focused access.

Instructions

[Shortcuts operations] List all available shortcuts with optional limit

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoOptional limit on the number of shortcuts to return

Implementation Reference

  • Generates AppleScript to list all shortcuts (with optional limit), formats names as JSON array.
    script: (args) => `
      try
        tell application "Shortcuts"
          set shortcutNames to name of every shortcut
          
          ${args.limit ? `
          -- Apply limit if specified
          if (count of shortcutNames) > ${args.limit} then
            set shortcutNames to items 1 through ${args.limit} of shortcutNames
          end if
          ` : ``}
        end tell
        
        -- Convert to JSON string manually
        set jsonOutput to "{"
        set jsonOutput to jsonOutput & "\\"status\\": \\"success\\","
        set jsonOutput to jsonOutput & "\\"shortcuts\\": ["
        
        repeat with i from 1 to count of shortcutNames
          set currentName to item i of shortcutNames
          set jsonOutput to jsonOutput & "{\\"name\\": \\"" & currentName & "\\"}"
          if i < count of shortcutNames then
            set jsonOutput to jsonOutput & ", "
          end if
        end repeat
        
        set jsonOutput to jsonOutput & "]}"
        return jsonOutput
        
      on error errMsg
        return "{\\"status\\": \\"error\\", \\"message\\": \\"" & errMsg & "\\"}"
      end try
    `,
  • Defines input schema for the tool, accepting optional 'limit' parameter of type number.
    schema: {
      type: "object",
      properties: {
        limit: {
          type: "number",
          description: "Optional limit on the number of shortcuts to return",
        },
      },
    },
  • src/index.ts:33-33 (registration)
    Registers the 'shortcuts' category containing the 'list_shortcuts' script, enabling the tool 'shortcuts_list_shortcuts'.
    server.addCategory(shortcutsCategory);
  • Dynamically generates MCP tool list entries, constructing tool name as '{category}_{script}' e.g. 'shortcuts_list_shortcuts'.
    category.scripts.map((script) => ({
      name: `${category.name}_${script.name}`, // Changed from dot to underscore
      description: `[${category.description}] ${script.description}`,
      inputSchema: script.schema || {
        type: "object",
        properties: {},
      },
    })),
  • Executes the tool by invoking the script generator function with arguments and running the resulting AppleScript via osascript.
    const scriptContent =
      typeof script.script === "function"
        ? script.script(request.params.arguments)
        : script.script;
    
    const result = await this.executeScript(scriptContent);
    
    this.log("info", "Tool execution completed successfully", { 
      tool: toolName,
      resultLength: result.length
    });
    
    return {
      content: [
        {
          type: "text",
          text: result,
        },
      ],
    };
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions the list operation and optional limit but lacks critical behavioral details: whether this is a read-only operation, if it requires permissions, how results are ordered/formatted, pagination handling, or error conditions. For a list tool with zero annotation coverage, this is insufficient.

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

Conciseness4/5

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

The description is a single, efficient sentence that front-loads the core purpose. However, the bracketed prefix '[Shortcuts operations]' is redundant with the tool name and could be removed for better conciseness.

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 simple parameter, the description is incomplete. It doesn't explain what a 'shortcut' is in this context, the format of returned data, or any behavioral traits. For a tool that likely returns structured data, more context is needed.

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%, with the single parameter ('limit') fully documented in the schema. The description adds no additional meaning beyond restating 'optional limit' from the schema. Baseline 3 is appropriate when 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 verb ('List') and resource ('all available shortcuts'), making the purpose unambiguous. However, it doesn't distinguish this tool from potential sibling list operations (like 'notes_list' or 'mail_list_emails') beyond the domain specificity implied by the tool name.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context (e.g., when listing is needed), or compare with other shortcuts tools (like 'shortcuts_run_shortcut'). The optional limit is noted but without rationale.

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

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