Skip to main content
Glama

Start Shell Session

start_shell_session

Starts a persistent interactive PTY session for shells, long-running apps, debuggers, or REPLs, returning an ID for writing input and reading output.

Instructions

Start a persistent interactive PTY session and return its id.

With command=None spawns an interactive shell. With a command, runs shell -c <command> inside the PTY - ideal for long-running apps, debuggers (gdb), REPLs, or anything needing a TTY. Use write_to_session / read_session_output to interact.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "start_shell_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNo
sudoNo
shellNo/bin/bash
commandNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It discloses persistence, PTY nature, command execution via `shell -c`, and id return, but omits sudo implications, cwd behavior, permissions, session lifetime, and cleanup expectations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the purpose and return value, then explains modes and interaction in dense, useful sentences. There is no redundant wording.

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

Completeness3/5

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

Core session behavior is adequately described, and an output schema covers return values. However, with no annotations, 0% schema coverage, and a persistent-session tool, missing sudo/cwd semantics and close_shell_session guidance are notable gaps.

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

Parameters2/5

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

Schema coverage is 0% for four parameters. The description clarifies `command=None` versus a command string and implicitly references the `shell` parameter, but never explains `cwd` or `sudo`, leaving half the inputs undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (start) and resource (persistent interactive PTY session), plus the returned id. It explains the two command modes and points to write/read for interaction, though it does not explicitly contrast with start_process.

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?

Explains when to use each mode: no command for an interactive shell, a command for long-running apps, debuggers, REPLs, or TTY-needing workloads. It names follow-up tools for interaction, but gives no explicit exclusions or alternatives such as start_process.

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

Deploy Server

Other Tools