Skip to main content
Glama

pty_send_command

Send a command to a live interactive terminal session and capture its output. Handles session creation/reconnection, ideal for TTY-aware programs like REPLs and interactive shells.

Instructions

Send a command to an interactive PTY session and capture its output.

Creates the session if it does not exist (or reconnects if it does), opens the WebSocket data plane, writes the command, and reads output until the terminal is quiet for idle_timeout seconds (or max_wait elapses).

Prefer execute_command for non-interactive commands; use this for TTY-aware programs (REPLs, TUIs, interactive shells).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
colsNoInitial terminal width in character cells (1..1000).
rowsNoInitial terminal height in character cells (1..1000).
commandYesThe shell command to run inside the PTY.
max_waitNoHard cap on total time spent collecting output.
idle_timeoutNoStop reading after this many seconds of silence.
session_nameYesClient-chosen PTY session name (``[A-Za-z0-9_-]``, 1..256).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

No annotations exist, so the description carries full burden. It discloses session creation/reconnection, WebSocket data plane usage, and the idle_timeout/max_wait completion logic. It does not cover error handling or edge cases, but the output schema likely addresses return structure.

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?

Three sentences: purpose, process, guidance. Each sentence earns its place, with the most important information front-loaded. No filler or 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?

For a 6-parameter tool with an output schema, the description covers purpose, lifecycle, timing behavior, and alternatives. It leaves some edge-case behavior (e.g., errors, exit codes) unspecified, but the existence of an output schema mitigates the need to describe return values.

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 baseline is 3. The description adds semantic depth by explaining that session_name triggers creation/reconnection and how idle_timeout and max_wait control read termination, going beyond the parameters' own descriptions.

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?

Opening sentence states 'Send a command to an interactive PTY session and capture its output' – a specific verb and resource. It further distinguishes itself from siblings by explicitly contrasting with execute_command in the final sentence.

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?

Provides explicit when-to-use guidance: 'Prefer execute_command for non-interactive commands; use this for TTY-aware programs (REPLs, TUIs, interactive shells).' This names the alternative and gives concrete usage context.

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/contributory/runloop-mcp'

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