Skip to main content
Glama
jayashankarvr

execkit-mcp

session_exec

Destructive

Run a shell command in an existing session and return structured JSON (stdout, stderr, exit code). Shape output with an optional budget.

Instructions

Run a command in a session; returns ExecResult JSON (stdout, stderr, exit_code, duration_ms, cwd, truncated). Non-interactive: stdin is closed - no prompts, REPLs, or editors; use sudo -n. Default timeout 120s (EXECKIT_MCP_EXEC_TIMEOUT); timeout_secs overrides per call (max 3600). On timeout the command is interrupted (exit_code 124, timed_out:true); the session stays usable. For long jobs, background: nohup CMD > /tmp/x.log 2>&1 & then poll cat /tmp/x.log. exit, or a set -e failure, ends the shell and closes the session. Optional budget shapes output: {grep:{pattern,context?}, keep:{mode:"all"|"tail"|"head"|"head_tail",n?|head?+tail?}, max_chars?} - line-based, after redaction; never changes exit code/side effects; adds a report (mode + lines_total/lines_kept). Truncated unbudgeted output adds a hint. Redacted output is not file-accurate: never write it back to a file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budgetNoShape THIS command's output (overrides the session default).
commandYesThe shell command to run.
session_idYesSession id from session_create.
timeout_secsNoTimeout for THIS command in seconds (default 120, or EXECKIT_MCP_EXEC_TIMEOUT; clamped to 1..=3600). On timeout the command is interrupted and the session stays usable.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.10.1
    • addedInput schema / $defs / KeepParams / properties / mode / enum
      Added value: +[
      +  "all",
      +  "tail",
      +  "head",
      +  "head_tail"
      +]
    • addedInput schema / properties / timeout_secs
      Added value: +{
      +  "default": null,
      +  "description": "Timeout for THIS command in seconds (default 120, or\nEXECKIT_MCP_EXEC_TIMEOUT; clamped to 1..=3600). On timeout the command\nis interrupted and the session stays usable.",
      +  "format": "uint64",
      +  "minimum": 0,
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
  2. First observedv0.8.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the openWorldHint/destructiveHint annotations: timeout semantics (exit_code 124, timed_out:true, session remains usable), default and max timeout values, session termination triggers ('exit', or a `set -e` failure), and the guarantee that budget shaping never changes exit code or side effects. The redaction caveat ('never write it back to a file') is a genuinely non-obvious safety detail.

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 with purpose and return shape, and every clause carries information with no filler. However, the heavy semicolon chaining and nested parentheticals make the constraints harder to scan than they need to be; a few of the later sentences could be tightened.

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?

No output schema exists, and the description compensates by enumerating the returned fields, documenting timeout and session-lifetime behavior, and covering output shaping and redaction. An agent has everything needed to invoke this correctly and interpret the result.

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 exceeds it by explaining budget semantics that the schema only names - the grep -> line-keep -> char-cap ordering, that it runs after redaction, and that it emits a report (mode + lines_total/lines_kept). It also restates the timeout override/clamp behavior, so most of the gain is on the budget parameter.

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?

Opens with a specific verb+resource ('Run a command in a session') and immediately states the return shape (ExecResult JSON with stdout, stderr, exit_code, duration_ms, cwd, truncated). No sibling does execution, so an agent can route here unambiguously 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 Guidelines5/5

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

Explicit when-not conditions ('Non-interactive: stdin is closed - no prompts, REPLs, or editors') plus the concrete workaround ('use `sudo -n`'). Also covers the tricky case of long jobs ('nohup CMD > /tmp/x.log 2>&1 &' then poll `cat /tmp/x.log`), which is exactly the guidance an agent needs to avoid a hanging call.

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