Skip to main content
Glama
Sai-Adarsh

Coyote MCP Server

by Sai-Adarsh

Run AppleScript

run_applescript

Execute AppleScript commands on macOS to automate tasks or control applications through the Coyote MCP Server.

Instructions

Executes an AppleScript command using osascript on macOS.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesAppleScript code to execute.

Implementation Reference

  • The handler function for the 'run_applescript' tool. It spawns an 'osascript' process with the provided script, captures stdout and stderr, and returns the result or error message.
    async ({ script }) => {
      return new Promise((resolve) => {
        const proc = spawn("osascript", ["-e", script]);
        let output = "";
        let error = "";
        
        proc.stdout.on("data", (data) => {
          output += data.toString();
        });
        
        proc.stderr.on("data", (data) => {
          error += data.toString();
        });
        
        proc.on("close", (code) => {
          const result = code === 0 
            ? (output.trim() || "Command executed successfully")
            : `Error: ${error.trim() || "Unknown error"}`;
            
          resolve({
            content: [{ 
              type: "text", 
              text: result 
            }]
          });
        });
      });
    }
  • Input schema for the 'run_applescript' tool, defining a required 'script' string parameter.
    inputSchema: {
      script: z.string().describe("AppleScript code to execute.")
    }
  • src/index.ts:25-62 (registration)
    Registration of the 'run_applescript' tool using server.registerTool, including name, schema, and handler.
    server.registerTool(
      "run_applescript",
      {
        title: "Run AppleScript",
        description: "Executes an AppleScript command using osascript on macOS.",
        inputSchema: {
          script: z.string().describe("AppleScript code to execute.")
        }
      },
      async ({ script }) => {
        return new Promise((resolve) => {
          const proc = spawn("osascript", ["-e", script]);
          let output = "";
          let error = "";
          
          proc.stdout.on("data", (data) => {
            output += data.toString();
          });
          
          proc.stderr.on("data", (data) => {
            error += data.toString();
          });
          
          proc.on("close", (code) => {
            const result = code === 0 
              ? (output.trim() || "Command executed successfully")
              : `Error: ${error.trim() || "Unknown error"}`;
              
            resolve({
              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 the full burden of behavioral disclosure. It states the action ('executes') but does not describe what happens during execution—such as whether it runs synchronously, returns output, handles errors, requires specific permissions, or has side effects. For a tool that executes scripts with potential system impact, this is a significant gap in 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: 'Executes an AppleScript command using osascript on macOS.' It is front-loaded with the core action, has zero wasted words, and appropriately sized for the tool's simplicity. Every part of the sentence earns its place by specifying what, how, and where.

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 system scripts and the lack of annotations and output schema, the description is incomplete. It does not address behavioral aspects like error handling, output format, or security implications, which are critical for such a tool. The description alone is insufficient for safe and effective use by an AI agent.

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 one parameter ('script') documented as 'AppleScript code to execute.' The description does not add any meaning beyond this, as it only repeats that it executes an AppleScript command without detailing parameter syntax or constraints. With high schema coverage, the baseline score of 3 is appropriate.

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 tool's purpose: 'Executes an AppleScript command using osascript on macOS.' It specifies the verb ('executes'), resource ('AppleScript command'), and implementation detail ('using osascript on macOS'), making it unambiguous. However, since there are no sibling tools, the distinction aspect is not applicable, preventing a perfect score of 5.

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 mentions the implementation ('using osascript on macOS'), which implies platform specificity, but does not explicitly state when this tool is appropriate or what prerequisites might be needed (e.g., macOS requirement, permissions). No exclusions or alternatives are mentioned.

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/Sai-Adarsh/coyote-mcp-server'

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