Skip to main content
Glama

run_command

Execute a shell command in the workspace root and return its standard output, standard error, and exit code. Use for running tests, linters, formatters, and build steps in automated pipelines.

Instructions

Execute a shell command in the workspace root and return stdout, stderr, exit code.

Use this for running tests (pytest, playwright), linters (black, ruff), formatters, build steps, or any other shell command the pipeline needs to execute hands-free. Intended for use by pipeline agents, not general chat.

Windows note: Do NOT use pytest-xdist parallel flags (-n auto, -n N) in commands passed to this tool. Worker subprocesses inherit stdout/stderr pipe handles and can prevent the tool from returning if a worker exits abnormally. Use plain pytest tests/ -q instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesShell command to run (e.g. ".venv/Scripts/pytest tests/ -q"). Executed in the workspace root directory with shell=True.
timeoutNoSeconds before the process is killed. Default 60s. Maximum 600s. Increase for slow test suites or Playwright runs, but prefer splitting large suites into smaller targeted runs.
max_output_charsNoTruncate combined output to this many characters to avoid flooding the context window. Default 20000.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses that the tool returns stdout, stderr, and exit code, mentions output truncation via max_output_chars, timeout behavior, and a Windows-specific pitfall (pytest-xdist causing hangs). This provides adequate transparency for a command execution tool.

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 compact: a one-sentence purpose, a bullet-like usage list, and a short Windows note. It is front-loaded with the key action and output, with no extraneous text. Every sentence serves a purpose.

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?

Given the tool's complexity (3 parameters, output schema exists), the description covers use cases, limitations (timeout, truncation), and a platform-specific warning. It is complete enough for an agent to understand invocation and potential issues.

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 coverage is 100%, so the baseline is 3. The description adds value by noting the Windows avoidance of pytest-xdist flags, which enriches the semantics of the 'command' parameter. The schema descriptions are detailed, and the tool description reinforces proper usage without redundancy.

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 description explicitly states 'Execute a shell command in the workspace root and return stdout, stderr, exit code.' It uses a specific verb ('execute') and resource ('shell command'), clearly distinguishing it from sibling tools like get_pipeline_status and notify_orchestrator by stating its intended use for pipeline agents running tests, linters, etc.

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?

The description provides clear guidance on when to use the tool: 'running tests, linters, formatters, build steps' and explicitly states it is 'not for general chat.' It includes a critical Windows note about avoiding pytest-xdist flags, which helps prevent failures. However, it does not explicitly contrast with alternatives among siblings.

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/saajunaid/junai'

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