Skip to main content
Glama
kagan-sh

Kagan - AI Orchestration Layer

terminal_run

Execute long-running shell commands and stream their output incrementally with configurable timeout and line limits. Returns final output, exit code, and timeout status.

Instructions

Run a long-running terminal command and stream its output.

Designed for commands that produce output over time: test runners, build pipelines, or any program that writes incrementally to stdout.

Each output line is forwarded as a tool_execution_update event on the per-task event stream when a task context is available, allowing clients to render partial output in real time.

Parameters

command: Shell command string (passed to /bin/sh -c or cmd.exe /c). cwd: Working directory. Defaults to the server process cwd. timeout: Wall-clock timeout in seconds (default 600 — 10 minutes). Pass null for no limit. max_output_lines: Maximum lines retained in the final output field. Lines beyond this limit are still forwarded to the event stream but are not included in the final return value.

Returns

{"output": str, "exit_code": int, "timed_out": bool}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYes
cwdNo
timeoutNo
max_output_linesNo
Behavior5/5

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

No annotations, but description fully discloses streaming, timeouts, line retention behavior, and that it runs via shell. Behavior is transparent and actionable.

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 intro, parameter list, and return value. Slightly lengthy but each sentence adds value. Could be more compact but still efficient.

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?

All parameters and return value are explained. No output schema needed. Streaming behavior and limits are clarified. Complete for a tool with moderate complexity.

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?

Schema has 0% description coverage, but description adds detailed semantics for all 4 parameters, including defaults and nuances like 'pass null for no limit' and 'lines beyond limit still forwarded to stream but not in final output.'

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 clearly states the tool runs a long-running terminal command and streams output. It differentiates from siblings like bash_exec by emphasizing 'long-running' and streaming via tool_execution_update events.

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?

Provides explicit guidance: 'Designed for commands that produce output over time: test runners, build pipelines, or any program that writes incrementally to stdout.' Does not explicitly exclude alternatives, but context is clear.

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/kagan-sh/kagan'

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