Skip to main content
Glama

shortcuts_list_shortcuts

Retrieve a list of available macOS shortcuts with customizable limits, enabling streamlined automation and interaction via AppleScript-based workflows.

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

  • Handler for 'shortcuts_list_shortcuts' tool: defines schema (optional 'limit' param) and generates AppleScript to list shortcuts from Shortcuts app, format as JSON, with error handling.
    { name: "list_shortcuts", description: "List all available shortcuts with optional limit", schema: { type: "object", properties: { limit: { type: "number", description: "Optional limit on the number of shortcuts to return", }, }, }, 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 `, },
  • src/index.ts:33-33 (registration)
    Registers the 'shortcuts' category (containing 'list_shortcuts' script) with the AppleScriptFramework server instance.
    server.addCategory(shortcutsCategory);
  • Dynamically generates MCP tool list entries for all category scripts, constructing full name as 'category_script' (e.g., 'shortcuts_list_shortcuts') with schema from script definition.
    tools: this.categories.flatMap((category) => 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: {}, }, })), ),
  • Generic MCP tool call handler: parses tool name (category_script), generates script content from script.script(args), executes via osascript, returns result. Specific to shortcuts_list_shortcuts via category/script lookup.
    const scriptContent = typeof script.script === "function" ? script.script(request.params.arguments) : script.script; const result = await this.executeScript(scriptContent);

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