Skip to main content
Glama

Create terminal session

terminal_create

Spawn a new terminal session and return its sessionId for interactive shells or one-off commands like tests and TUIs. Call before any per-session tool; sessions persist until destroyed or evicted.

Instructions

Spawn a new terminal session and return its sessionId. You must call this before any per-session tool — there is no shared default session. By default the session is an interactive shell. Pass command to run one program in the terminal instead (a TUI, a test run, a CLI under test): the session then lasts as long as that program, reports its exit status when it ends, and keeps its final screen readable until you destroy it. If the server already holds 50 live sessions, the least-recently-used one is evicted to make room (its sessionId is tombstoned and any later call against it will respawn with an 'evicted' notice).

Input Schema

NameRequiredDescriptionDefault
cwdNoOverride the default working directory.
envNoEnvironment variables to set for the session, on top of the server's own environment.
colsNo
rowsNo
labelNoOptional human-readable name shown in terminal_list output (e.g. "dev-server").
loginNoStart the shell as a login shell (`-l`), so it reads the profile files (~/.zprofile, ~/.bash_profile, ~/.profile) where PATH is usually set up. Use it when tools that work in the user's own terminal are "command not found" here — typical when the MCP client was started from a GUI rather than a terminal. Slower to start. No effect in PowerShell or cmd.exe. Default false (or the server's --login flag).
shellNoOverride the default shell (e.g. "/bin/zsh"; on Windows "pwsh.exe" or "cmd.exe" instead of PowerShell).
themeNoColor palette used by terminal_screenshot and terminal_click previews for THIS session. Persists across auto-respawn / hardReset. Default "dark" (VS Code Dark+). Options: "dark", "light", "solarized-dark", "solarized-light".
commandNoRun this command line instead of an interactive shell, e.g. "vim notes.txt" or "npm test". It is run through the session's shell (`sh -c`; on Windows PowerShell `-Command`, or `cmd /c`), so quoting, pipes and redirection work as at that shell's prompt. Input tools talk to the program directly. When it exits, its exit status is reported, the final screen stays readable, and nothing is restarted automatically.
scrollbackNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations declare a non-readonly, non-destructive, non-idempotent, closed-world write, and the description goes well beyond that: it discloses the 50-session LRU eviction with tombstoning and 'evicted' respawn behavior, plus command-mode lifecycle semantics (session lives as long as the program, exit status reported, final screen retained until destroy). This is exactly the kind of behavioral context annotations cannot carry.

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?

One dense paragraph, but well front-loaded: purpose and prerequisite first, command semantics second, eviction last. Every sentence carries information; it is long only because the tool genuinely has three behavioral clauses worth knowing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter, zero-required, no-output-schema tool, the description covers the essential call semantics: prerequisite ordering, default interactive mode, command mode, and capacity/eviction. The only gap is the silent geometry/scrollback parameters, which are secondary to correct invocation.

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

Parameters3/5

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

Schema description coverage is 70%, so the baseline is 3. The description adds real meaning for `command` (session lifetime, exit status, non-restart) and for the interactive-default contrast, but `cols`, `rows`, and `scrollback` remain undocumented in both schema and description, and `cwd`/`env` are only lightly described.

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?

States a specific verb and resource ('Spawn a new terminal session') and immediately declares the return value (sessionId), which is the key artifact for the siblings. It also differentiates itself from every per-session tool by establishing that it is the mandatory entry point.

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?

Explicitly states the prerequisite ('You must call this before any per-session tool — there is no shared default session') and elaborates the when-to-use-command-vs-interactive-shell decision with concrete examples (TUI, test run, CLI under test). The 50-session eviction rule is stated as a condition affecting usage. Nothing critical is left to inference.

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