Skip to main content
Glama
Apple Container MCP Server

Apple Container MCP Server

by joeshirey

exec_in_container

Run commands inside a running container and return their output, with optional environment variables, user override, and working directory for targeted execution.

Instructions

Run a command inside a running container and return its output.
`command` is a list of strings, e.g. ["ls", "-la", "/app"].
Use `env` for extra environment variables (KEY=VALUE format),
`user` to override the user (e.g. "root"), and `workdir` for the working directory.
Examples:
  exec_in_container("myapp", ["cat", "/etc/os-release"])
  exec_in_container("db", ["psql", "-U", "postgres", "-c", "SELECT 1"], user="postgres")

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "container_id": "<container_id>",
      "command": "<command>"
    },
    "name": "exec_in_container"
  }
}

Input Schema

NameRequiredDescriptionDefault
envNo
userNo
commandYes
workdirNo
container_idYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.2

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden: it clarifies that arbitrary commands execute inside the container and that output is returned, which is the most important behavioral fact. It says nothing about failure semantics (non-zero exit codes, stderr handling), timeouts, or the fact that commands can mutate container state — gaps that matter for an arbitrary-execution tool with no destructiveHint coverage.

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?

Front-loaded sentence states the action and result, followed by a compact parameter gloss and two illustrative examples. Slightly padded by both prose and examples covering the same ground, but everything is scannable and earns its place.

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?

An output schema exists, so return-value details need not be explained, and the description covers the executable semantics plus nearly every parameter despite 0% schema coverage. For a 5-parameter arbitrary-command tool this is sufficient to call it correctly; only edge-case behavior (exit codes, timeouts) is left out.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does for four of five parameters: command as an exec-form string list with a concrete example, env as KEY=VALUE, user with a "root" example, and workdir as the working directory. Only container_id is left unexplained, though it is self-evident from the name and required fields.

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?

State-specific verb+resource: "Run a command inside a running container and return its output" tells an agent exactly what happens and constrains it to existing/running containers. It implicitly distinguishes itself from run_container (create+run) and start_container, though it never names those siblings explicitly.

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

Usage Guidelines3/5

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

The phrase "inside a running container" implies the precondition that the container must already be running, and the two examples show realistic invocations. However there is no explicit when-to-use/when-not guidance, no pointer to run_container/start_container as the alternative for a non-running container, and no note about cleaning up or tearing down state.

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