Skip to main content
Glama

iterm_run

Execute terminal commands in iTerm directly from LLM applications, with options to run in new windows or existing sessions.

Instructions

[iTerm terminal operations] Run a command in iTerm

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesCommand to run in iTerm
newWindowNoWhether to open in a new window (default: false)

Implementation Reference

  • Core handler logic for 'iterm_run' tool: generates AppleScript to run the specified command in an iTerm window, optionally in a new window.
    script: (args) => `
      tell application "iTerm"
        ${
          args.newWindow
            ? `
          set newWindow to (create window with default profile)
          tell current session of newWindow
        `
            : `
          set w to current window
          tell w's current session
        `
        }
          write text "${args.command}"
          activate
        end tell
      end tell
    `,
  • Input schema definition for the 'iterm_run' tool, specifying 'command' as required and optional 'newWindow' parameter.
    schema: {
      type: "object",
      properties: {
        command: {
          type: "string",
          description: "Command to run in iTerm",
        },
        newWindow: {
          type: "boolean",
          description: "Whether to open in a new window (default: false)",
          default: false,
        },
      },
      required: ["command"],
    },
  • Registers tool names using '{category}_{script}' format, creating 'iterm_run' from 'iterm' category and 'run' script.
    name: `${category.name}_${script.name}`, // Changed from dot to underscore
  • src/index.ts:30-30 (registration)
    Registers the 'iterm' ScriptCategory containing the 'run' script (becomes 'iterm_run' tool).
    server.addCategory(itermCategory);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the basic action but lacks critical information: whether this executes commands synchronously or asynchronously, what happens with command output, error handling, security implications, or any side effects. The description doesn't compensate for the missing annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just two brief phrases. While efficient, the bracketed prefix '[iTerm terminal operations]' adds minimal value and could be considered slightly redundant given the tool name already indicates iTerm functionality.

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 command execution tool with no annotations and no output schema, the description is inadequate. It doesn't explain what happens after command execution, how output is handled, error conditions, or security considerations. The description should provide more context given the tool's potential complexity and impact.

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?

Schema description coverage is 100%, so the schema already fully documents both parameters. The description doesn't add any meaningful parameter semantics beyond what's in the schema - it mentions 'command' but provides no additional context about command syntax, restrictions, or the implications of the newWindow parameter.

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 ('Run a command') and target ('in iTerm'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from its sibling 'iterm_paste_clipboard', which also performs iTerm operations but with different functionality.

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. There's no mention of when to choose 'iterm_run' over 'iterm_paste_clipboard' or other terminal/system tools, nor any context about prerequisites or typical use cases.

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/joshrutkowski/applescript-mcp'

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