Skip to main content
Glama
Szowesgad

automator-mcp

run_applescript

Execute AppleScript code on macOS to automate tasks like sending emails, organizing files, and controlling system actions using the automator-mcp server.

Instructions

Execute AppleScript code on macOS

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesAppleScript code to execute

Implementation Reference

  • The handler function that executes the provided AppleScript using osascript and returns the result or error.
    async runAppleScript(script) { try { const result = execSync(`osascript -e '${script.replace(/'/g, "'\"'\"'")}'`, { encoding: 'utf8', }); return { content: [ { type: 'text', text: result.trim() || 'Script executed successfully', }, ], }; } catch (error) { throw new Error(`AppleScript error: ${error.message}`); } }
  • src/index.js:175-176 (registration)
    Dispatch case in CallToolRequestHandler that calls the runAppleScript handler.
    case 'run_applescript': return await this.runAppleScript(args.script);
  • src/index.js:37-50 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    { name: 'run_applescript', description: 'Execute AppleScript code on macOS', inputSchema: { type: 'object', properties: { script: { type: 'string', description: 'AppleScript code to execute', }, }, required: ['script'], }, },
  • Input schema defining the 'script' parameter for the run_applescript tool.
    inputSchema: { type: 'object', properties: { script: { type: 'string', description: 'AppleScript code to execute', }, }, required: ['script'], },

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/Szowesgad/automator-mcp'

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