Skip to main content
Glama
VetCoders

automator-mcp

by VetCoders

run_jxa

Execute JavaScript for Automation (JXA) code to control macOS system tasks and automate workflows directly from AI assistants.

Instructions

Execute JavaScript for Automation (JXA) code on macOS

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesJXA JavaScript code to execute

Implementation Reference

  • The core handler function that executes the JXA script using osascript with JavaScript language flag.
    async runJXA(script) {
      try {
        const result = execSync(`osascript -l JavaScript -e '${script.replace(/'/g, "'\"'\"'")}'`, {
          encoding: 'utf8',
        });
        
        return {
          content: [
            {
              type: 'text',
              text: result.trim() || 'Script executed successfully',
            },
          ],
        };
      } catch (error) {
        throw new Error(`JXA error: ${error.message}`);
      }
    }
  • src/index.js:51-64 (registration)
    Registration of the 'run_jxa' tool in the ListTools response, including description and input schema.
    {
      name: 'run_jxa',
      description: 'Execute JavaScript for Automation (JXA) code on macOS',
      inputSchema: {
        type: 'object',
        properties: {
          script: {
            type: 'string',
            description: 'JXA JavaScript code to execute',
          },
        },
        required: ['script'],
      },
    },
  • Input schema definition for the 'run_jxa' tool, specifying the 'script' parameter.
    inputSchema: {
      type: 'object',
      properties: {
        script: {
          type: 'string',
          description: 'JXA JavaScript code to execute',
        },
      },
      required: ['script'],
    },
  • Dispatch handler in CallToolRequest that routes 'run_jxa' calls to the runJXA method.
    case 'run_jxa':
      return await this.runJXA(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 does not mention critical traits like permissions required, potential side effects (e.g., system modifications), error handling, or output format. This leaves significant gaps for a tool that executes code, which is inherently risky without transparency.

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 front-loads the core purpose without unnecessary words. Every part earns its place by clearly stating the tool's function, making it highly concise and well-structured for quick understanding.

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 the complexity of executing code (a potentially destructive operation) and the lack of annotations and output schema, the description is incomplete. It fails to address safety, permissions, or result handling, which are crucial for an agent to use this tool correctly and safely in context.

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 schema description coverage is 100%, with the single parameter 'script' fully documented in the schema as 'JXA JavaScript code to execute'. The description adds no additional meaning beyond this, such as syntax examples or constraints, so it meets the baseline of 3 where the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Execute') and resource ('JavaScript for Automation (JXA) code on macOS'), distinguishing it from sibling tools like run_applescript (different scripting language) and system_automation (broader automation). It precisely communicates what the tool does without being vague or tautological.

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_applescript or system_automation. It lacks explicit when/when-not instructions, prerequisites (e.g., macOS requirement implied but not stated), or comparisons to sibling tools, leaving the agent with minimal context for selection.

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