Skip to main content
Glama
almahdi
by almahdi

pty_spawn

Destructive

Spawn persistent pseudo-terminal sessions to run long-running processes, send interactive commands, and manage multiple concurrent terminal sessions in real-time.

Instructions

Spawns a new PTY (pseudo-terminal) session that runs in the background.

Unlike synchronous bash commands, PTY sessions persist and allow you to:

  • Run long-running processes (dev servers, watch modes, etc.)

  • Send interactive input (including Ctrl+C, arrow keys, etc.)

  • Read output at any time

  • Manage multiple concurrent terminal sessions

Returns the session ID, which you can use with other pty_* tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesThe command to execute (e.g., 'npm', 'python', 'bash')
argsNoArguments to pass to the command
workdirNoWorking directory (defaults to project root)
envNoAdditional environment variables
titleNoHuman-readable name for the session
descriptionYesClear, concise 5-10 word description of what this command does
notifyOnExitNoReceive notification when process exits (default: false)
Behavior4/5

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

The description adds valuable context beyond annotations: it explains that sessions 'persist and allow you to' run processes, send input, read output, and manage sessions, which clarifies the tool's interactive and persistent nature. Annotations indicate it's destructive (destructiveHint: true) and not read-only (readOnlyHint: false), which aligns with 'Spawns' implying creation, but the description doesn't explicitly warn about destructive effects like resource consumption or process management risks.

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?

The description is well-structured and front-loaded with the core purpose, followed by bullet points for key capabilities and a concluding sentence on the return value. Every sentence earns its place by providing essential information without redundancy.

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?

Given the complexity of spawning interactive sessions and the lack of an output schema, the description is mostly complete: it explains the tool's purpose, usage, and return value. However, it could better address behavioral risks implied by annotations (e.g., destructive effects) and provide more detail on error handling or session limits.

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?

With 100% schema description coverage, the schema already documents all 7 parameters thoroughly. The description adds no specific parameter semantics beyond implying the command and args are for execution, and the session ID is returned for use with other tools, which is minimal added value.

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 specific action ('Spawns a new PTY session') and resource ('pseudo-terminal session'), distinguishing it from sibling tools like pty_kill, pty_list, pty_read, and pty_write by focusing on creation rather than management or interaction with existing sessions.

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?

It explicitly states when to use this tool ('Unlike synchronous bash commands') and provides clear alternatives for specific use cases (e.g., 'Run long-running processes', 'Send interactive input'), though it doesn't name sibling tools directly, the context implies they are for managing spawned sessions.

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/almahdi/mcp-terminal'

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