Skip to main content
Glama
KevinBuettner

docent-terminal-mcp

run

Type commands into a persistent terminal session and wait for output, exit status, or the next prompt; works with shells and interactive programs.

Instructions

Type a line into the session, press Enter, and wait for the result: the session's form of a shell tool call, and of a line typed at gdb's or python's prompt.

At a bash prompt (shell integration) it waits for the command to exit and returns its output with the exit status (pipestatus for a pipeline; no ; echo $? needed); for a build or a testsuite give timeout_s the whole run (up to 1500 s) and get the exit status in one reply. Inside a program (gdb, python, psql, ...) it waits for the program's next prompt; starting one from bash returns at its first prompt, or its first screen (vim, less; continue with send). The session persists: cwd, variables and a running program stay between calls.

Output longer than max_lines keeps its first and last lines with a marker naming what was left out; nothing is lost: read pages it, search finds lines in it. So no | tail, | head, 2>&1 > log -- and never a pipe or redirect on an interactive program (gdb without -batch, python): it then waits at a prompt you cannot see. To watch for particular lines as they come, show=REGEX replies with the matching lines and the last few while the command runs unfiltered, exit status its own.

At timeout_s -- a short one gives your turn back soon -- the command keeps running and its region stays open: wait keeps waiting, send keys=["ctrl+c"] interrupts, send signal="TERM" if it survives. until=REGEX returns as soon as the output matches.

Several lines go one at a time, each once the previous is back at the prompt; a line that asks a question or times out stops the rest. Into Python or IPython they go as one paste (an exception drops the lines after it). Predictable questions: expect. Keystrokes (ctrl+c, tab, arrows) are send's keys, not an argument here.

prompt_pattern is rarely needed: never pass one to start a program (shell, gdb, pdb, lldb, python and any prompt ending in $ # % > are known); only after a reply came back "waiting" at a prompt it did not know, which then offers the pattern.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
showNoregex: reply with only the output lines matching it, in order, plus the last few (like `| grep`, but the command runs unfiltered and the log keeps everything), e.g. "error:|warning:|^FAIL" for a build -- or a program's answer: gdb's `step` under `set debug infrun 1`
forceNotype even over someone else's unsubmitted line at the prompt, discarding it first; only for a line you know is stale
inputYesthe line to type (Enter is added); several lines are sent one at a time, each after the previous is back at a prompt
untilNoregex: return as soon as the output matches it, the command still running (status "until"; `wait` resumes); not a prompt pattern
typingNotype the input as a person would, for a human watching: {wps, mistakes, seed}
save_toNoa file to copy the command's output into, as `> FILE 2>&1` would, while the command itself runs unredirected (the reply and the log are as usual): written at once, kept up to date while it runs, written in full when it ends. A relative path is in the session's current directory; the file is on the machine this server runs on, even for a session over ssh. For a later diff or grep by other tools; `read` and `search` need no file
sessionYesthe session's name (from session_create or session_list)
max_linesNolines of output shown in the reply; longer output is clipped in the middle, led by its summary lines (test results, compiler errors, make's failure) when the middle holds them; all of it stays readable with `read`/`search`
settle_msNointo a program with no recognised prompt: return once output has been quiet this long and nothing is visibly working (default 3000)
timeout_sNoseconds to wait before giving up (the command keeps running; `wait` resumes); at most 1500
last_linesNoreply with only the last N lines of the output (like `| tail -N`, but the command runs unfiltered and the log keeps everything; the reply says where the rest is); with `show`, how many last lines follow the matches (default 3)
show_afterNowith `show`: also this many lines after each match (like `grep -A N`); a match is numbered "N:", a line after one "N-"
prompt_patternNoregex that marks the program's prompt at the end of the cursor line; rarely needed, the default knows shell, gdb, pdb, lldb and python prompts and any ending in $ # % >; pass one only after a reply came back "waiting" at a prompt it did not know (it offers the pattern); make it cover a part that changes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses session persistence (cwd, variables, running program survive), timeout semantics (command keeps running, region stays open, interruptible via `send signal=TERM`), output clipping with first/last lines retained, and exit-status/pipestatus return behavior. These are exactly the behavioral traits an agent needs and cannot get from the schema.

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?

Purpose is front-loaded in the first sentence and every subsequent paragraph maps to a capability or parameter, so little is pure filler. However, it is a dense ~380-word wall of prose with heavy parentheticals and em-dash asides that could be tightened without losing content.

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?

For a 13-parameter tool with an output schema, this covers the ground: it explains exit status/return shape, output retention and paging via siblings, timeout/resume flow, and multi-line input behavior. Nothing an agent needs to invoke it correctly is missing.

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, but the prose adds real meaning beyond the schema text: it explains *when* to set a short `timeout_s` ('gives your turn back soon'), that `show` is like grep over an unfiltered run, that `until` is 'not a prompt pattern', and how `max_lines` clipping interacts with `read`/`search`. It stops short of covering every parameter's interaction, but clearly exceeds the schema.

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 opening sentence gives a concrete verb and resource: 'Type a line into the session, press Enter, and wait for the result', and explicitly frames it as 'the session's form of a shell tool call'. It is immediately distinguishable from siblings like `send` (keystrokes) and `wait` (resuming), which the text also names.

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-to-use and when-not-to-use guidance throughout: use `show` to watch for lines, `until` to return early, `wait` to resume after a timeout, `send keys` for keystrokes, and 'never a pipe or redirect on an interactive program'. It also states that `prompt_pattern` is 'rarely needed' and the precise condition under which to pass one.

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