Skip to main content
Glama
VetCoders

automator-mcp

by VetCoders

run_applescript

Execute AppleScript code on macOS to automate tasks, control applications, and perform system operations through the automator-mcp server.

Instructions

Execute AppleScript code on macOS

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesAppleScript code to execute

Implementation Reference

  • Executes the provided AppleScript code using the `osascript` command via Node.js `execSync`, with single quote escaping for safety. Returns the result as MCP content or throws an 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:37-50 (registration)
    Registers the 'run_applescript' tool 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'],
      },
    },
  • Defines the input schema for the 'run_applescript' tool, requiring a 'script' property of type string.
    inputSchema: {
      type: 'object',
      properties: {
        script: {
          type: 'string',
          description: 'AppleScript code to execute',
        },
      },
      required: ['script'],
    },
  • Dispatches calls to the 'run_applescript' tool by invoking the runAppleScript method in the CallToolRequest handler.
    case 'run_applescript':
      return await this.runAppleScript(args.script);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Execute') but fails to describe critical traits such as security implications, permission requirements, error handling, or output format. This leaves significant gaps for an agent to understand the tool's behavior beyond its basic function.

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 directly states the tool's function without unnecessary words. It is front-loaded with the core action and resource, making it easy to parse quickly. There is no wasted verbiage, earning a top score for 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?

For a tool that executes code on macOS with no annotations and no output schema, the description is incomplete. It lacks information on behavioral aspects like safety, permissions, or result handling, and does not compensate for the absence of structured data. Given the potential complexity and risks of code execution, more context is needed for effective agent use.

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?

The input schema has 100% description coverage, with the single parameter 'script' documented as 'AppleScript code to execute'. The description adds no additional semantic context beyond this, such as examples or constraints on script content. Given the high schema coverage, the baseline score of 3 is appropriate as the schema handles the parameter documentation adequately.

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 ('Execute') and resource ('AppleScript code on macOS'), making the tool's purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'run_jxa' or 'system_automation', which prevents a perfect score, but the specificity of 'AppleScript' provides some implicit distinction.

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 like 'run_jxa' (for JavaScript for Automation) or 'system_automation'. It lacks context about prerequisites (e.g., macOS requirement) or typical use cases, offering only a basic functional statement without comparative or exclusionary advice.

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

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