Skip to main content
Glama

run_shell

Execute shell commands within a REPL environment, returning structured output with exit code and stdout. Supports stdin piping, timeout, and custom environment variables.

Instructions

Run a shell command inside a REPL context with structured output.

    Returns a dict so the caller can branch on exit_code and parse
    stdout without string-scraping. Every call is logged to evolution.db
    for later recall via `query_command_history`.

    Args:
        command: The shell command to execute.
        repl_id: REPL whose cwd the command runs in.
        timeout_seconds: Kill the process if it exceeds this (capped at 600).
        cwd: Override the REPL's cwd for this one call.
        use_shell: If True, pass to /bin/sh (enables pipes, redirects,
            glob expansion). Default False = tokenized exec, safer.
        env_extra: Additional env vars merged onto os.environ.
        stdin_input: Optional string piped to the command's stdin.
            Enables first-class stdin piping so CLI tools that read
            from stdin (jq, wc, grep, etc.) work without shell pipe
            syntax.  When None the child's stdin is /dev/null.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNo
commandYes
repl_idYes
env_extraNo
use_shellNo
stdin_inputNo
timeout_secondsNo
Behavior4/5

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

With no annotations, the description covers key behaviors: structured dict return, logging to evolution.db, timeout cap (600), use_shell tokenization vs. /bin/sh, env_extra merging, stdin piping. However, no mention of error handling or permission requirements.

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?

Well-structured with a clear docstring format and front-loaded purpose. Slightly verbose but each sentence adds value; could tighten the parameter descriptions minimally.

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 7 parameters, no output schema, and no annotations, the description is remarkably thorough: covers return format, logging, parameter behavior, and shell vs. execve trade-offs. Leaves no major gaps for an agent to infer.

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

Parameters5/5

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

All 7 parameters are individually explained with context (e.g., stdin_input enables first-class piping). Schema coverage is 0%, so the description fully compensates by adding meaning beyond property names.

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?

Description clearly states 'Run a shell command inside a REPL context with structured output,' specifying verb and resource. It distinguishes from siblings like run_python_in_repl by focusing on shell commands in a REPL.

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?

Implies usage for executing shell commands with structured output and logging, but lacks explicit when-to-use vs. siblings (e.g., send_to_shell). No exclusions or alternatives mentioned.

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/angrysky56/local-repl-mcp'

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