Skip to main content
Glama

Run a command on a Mac

exec_mac
Destructive

Runs an argv command on the Mac as the agent user. Waits up to wait_seconds (default 20, max 50): a command that ends in time returns exit_code, stdout and stderr (first 64 KiB each); a longer one returns a job that keeps running (get_mac_job). Shell syntax needs ["/bin/bash", "-lc", "..."]. A command is at most 64 KiB. The same request_key and arguments return the same job, never a second run. A command ends with what it started; ["nomac-service", "start", "api", "--", ...] keeps a server running.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoFolder to run in: relative to the workspace (the default), ~/… or absolute, such as ~/drive/src/app.
argvYesCommand and arguments, for example ["bash", "-lc", "xcodebuild -list"].
session_idNoMac session ID (ses_…). Optional: without it, the account's running Mac.
request_keyYesIdempotency key you choose (8-128 letters, digits and - _ . :). Repeat a lost call with the same key and arguments; a new key is new work.
wait_secondsNoWait this long (0-50, default 20; 40 for builds and tests) for the command to finish and return its output in this call.
timeout_secondsNoStop the command after this many seconds (1-3600, default 300). Builds and test runs: up to an hour.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / argv / description
      Previous value: -"Command and arguments as an array, for example [\"bash\", \"-lc\", \"xcodebuild -list\"]. Runs as the agent user in the workspace directory."New value: +"Command and arguments, for example [\"bash\", \"-lc\", \"xcodebuild -list\"]."
    • changedInput schema / properties / cwd / description
      Previous value: -"The folder to run in: relative to the workspace, or ~/… and absolute paths anywhere on the Mac (for example ~/drive/src/app). Default: the workspace."New value: +"Folder to run in: relative to the workspace (the default), ~/… or absolute, such as ~/drive/src/app."
    • changedInput schema / properties / request_key / description
      Previous value: -"Idempotency key you choose: 8-128 letters, digits, dashes, underscores, dots or colons. Retry a lost response with the same key and identical arguments; use a new key for new work."New value: +"Idempotency key you choose (8-128 letters, digits and - _ . :). Repeat a lost call with the same key and arguments; a new key is new work."
  2. Changed2 schema fields changed
    • changedInput schema / properties / session_id / description
      Previous value: -"Mac session ID (ses_…) returned by start_mac or list_mac_sessions."New value: +"Mac session ID (ses_…). Optional: without it, the account's running Mac."
    • changedInput schema / required
      Previous value: -[
      -  "session_id",
      -  "request_key",
      -  "argv"
      -]New value: +[
      +  "request_key",
      +  "argv"
      +]
  3. Changed2 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • changedOutput schema / (root)
      Previous value: -{
      -  "$schema": "http://json-schema.org/draft-07/schema#",
      -  "additionalProperties": {},
      -  "description": "The JSON response of the NoMac API for this operation",
      -  "properties": {
      -    "error": {
      -      "additionalProperties": {},
      -      "description": "Present only when the call failed",
      -      "properties": {
      -        "code": {
      -          "description": "Stable machine-readable error code, for example insufficient_credit",
      -          "type": "string"
      -        },
      -        "message": {
      -          "description": "What went wrong and what to do next",
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "code",
      -        "message"
      -      ],
      -      "type": "object"
      -    }
      -  },
      -  "type": "object"
      -}New value: +null
  4. Changed1 schema field changed
    • addedInput schema / properties / cwd
      Added value: +{
      +  "description": "The folder to run in: relative to the workspace, or ~/… and absolute paths anywhere on the Mac (for example ~/drive/src/app). Default: the workspace.",
      +  "maxLength": 1024,
      +  "minLength": 1,
      +  "type": "string"
      +}
  5. Changed3 schema fields changed
    • changedInput schema / properties / timeout_seconds / description
      Previous value: -"Stop the command after this many seconds (1-600, default 300)."New value: +"Stop the command after this many seconds (1-3600, default 300). Builds and test runs: up to an hour."
    • changedInput schema / properties / timeout_seconds / maximum
      Previous value: -600New value: +3600
    • changedInput schema / properties / wait_seconds / description
      Previous value: -"Wait this long (0-50, default 20) for the command to finish and return its output in this call."New value: +"Wait this long (0-50, default 20; 40 for builds and tests) for the command to finish and return its output in this call."
  6. Changed1 schema field changed
    • changedInput schema / properties / request_key / description
      Previous value: -"Idempotency key you choose (letters, digits, dash, underscore). Retry a lost response with the same key and identical arguments; use a new key for new work."New value: +"Idempotency key you choose: 8-128 letters, digits, dashes, underscores, dots or colons. Retry a lost response with the same key and identical arguments; use a new key for new work."
  7. Changed1 schema field changed
    • addedInput schema / properties / wait_seconds
      Added value: +{
      +  "description": "Wait this long (0-50, default 20) for the command to finish and return its output in this call.",
      +  "maximum": 50,
      +  "minimum": 0,
      +  "type": "integer"
      +}
  8. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the annotations (destructiveHint, openWorldHint, idempotentHint=false), the description discloses output truncation (first 64 KiB each of stdout/stderr), the 64 KiB command cap, job continuation semantics, and that the same request_key+arguments return the same job rather than a second run. This is rich behavioral context an agent needs to invoke it safely.

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 core action is front-loaded and each sentence carries distinct information (timeout behavior, job fallback, shell syntax, size limits, idempotency, process lifetime). It is dense but none of the content is redundant, though the final sentence takes a second read to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex 6-parameter tool with no output schema, the description covers what returns on success (exit_code, stdout, stderr), what happens when it doesn't finish (a job retrieved via get_mac_job), the size limits, and idempotency. Nothing essential to calling it correctly is missing.

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 documents all six parameters with defaults, ranges and formats. The description reinforces wait_seconds behavior and request_key idempotency but adds little per-parameter detail beyond what the schema already states, making the baseline 3 appropriate.

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 first sentence states a specific verb and resource: 'Runs an argv command on the Mac as the agent user.' It also distinguishes the tool from siblings by naming get_mac_job for commands that outlive the wait window, so an agent can tell exec_mac apart from job-retrieval tools without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives concrete when-to-use guidance: wait_seconds default/max, get_mac_job for longer commands, ['/bin/bash', '-lc', '...'] for shell syntax, and the nomac-service pattern for long-running servers. Context is clear, though it doesn't state explicit exclusions (e.g. when to prefer write_mac_file over running a command).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources