Skip to main content
Glama

Run a command in a service

RunServiceCommand
Destructive

Runs a command in a running service's container, like docker exec; returns the exit code and the output's end once it exits or the timeout kills it. Over a bound on command, stdin or timeout = refused (named). Cannot start = exit 127 or 126, Docker's error in stdout. Untrusted output.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "RunServiceCommand"
  }
}

Input Schema

NameRequiredDescriptionDefault
stdinNoWritten to stdin, then closed.
commandNoE.g. ["psql", "-c", "select 1"]; a shell line: ["sh", "-c", "ls | head"].
serviceNo
workspaceNoThe workspace: its id or name (ListWorkspaces). Omit when the account has one.
project_idNo
run_as_userNoEmpty = the container's. "root" can install packages.
timeout_secondsNo0 = default. Kills the main process only. Over ~50 may outlast your client: background long jobs.
working_directoryNoEmpty = the container's.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / workspace
      Added value: +{
      +  "description": "The workspace: its id or name (ListWorkspaces). Omit when the account has one.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A3.9/5.0
Behavior5/5

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

Beyond the annotations (destructive, openWorld, non-idempotent) the description discloses output shape (exit code plus the tail of output), that over-bound command/stdin/timeout is refused with the boundary named, that a failure to start surfaces as exit 127/126 with Docker's error in stdout, and that output is untrusted. That is real behavioral context an agent cannot get from the annotations alone.

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?

It is short and front-loads the core purpose, with no filler. The telegraphic phrasing ('Over a bound on command, stdin or timeout = refused (named)') costs a little readability, but every clause carries information.

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

Completeness4/5

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

For an 8-parameter mutation tool with no output schema, the description covers return semantics, refusal boundaries, startup failure modes and the untrusted-output caveat. It does not say which parameters are actually needed to run (schema marks none required), which is the main remaining gap.

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?

At 75% schema coverage the baseline is 3, and the description adds only a partial constraint: it says limits exist on command, stdin and timeout without stating their values. It adds no meaning to service, project_id or working_directory beyond what the schema already documents.

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 first clause names a specific verb and resource ('Runs a command in a running service's container') and anchors it with the 'like docker exec' analogy, which cleanly separates it from siblings such as QueryContainerLogs or RunMachineAction. It stops short of explicitly contrasting with those siblings by name.

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?

Usage context is implied rather than stated: the docker exec analogy tells an agent what class of task fits, and the note that a timeout over ~50s should be used for 'background long jobs' hints at scheduling. There is no explicit 'use this instead of X' routing and no prerequisites section.

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