Skip to main content
Glama

opencode_pty

Create, list, inspect, resize, rename, and close terminal PTY sessions to run commands in a chosen working directory with custom args and environment variables.

Instructions

Manage terminal (PTY) sessions. Actions: list (all PTY sessions), create (new terminal with command/args/cwd), get (session by ID), update (resize or rename), remove (close session). Skip 'connect' — it's a WebSocket upgrade.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "action": "<action>"
    },
    "name": "opencode_pty"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoPTY session ID (required for get/update/remove)
cwdNoWorking directory (for create)
envNoJSON object of environment variables (for create)
argsNoJSON array of arguments (for create)
colsNoTerminal columns (for update — resize)
rowsNoTerminal rows (for update — resize)
titleNoSession title (for create/update)
actionYes
commandNoCommand to run (for create)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It discloses only that 'connect' is a WebSocket upgrade and that remove closes a session; it says nothing about whether close is permanent for running processes, whether create spawns a real shell with security implications, permission requirements, or how env/args JSON strings are handled. For a tool that spawns processes and terminates sessions, that is a significant disclosure gap.

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?

Two sentences: the first states the resource, the second front-loads the action inventory with the relevant parameters inline and ends with the one caveat that matters. No filler and nothing redundant.

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?

With nine parameters, one required discriminator, no output schema and no annotations, the description covers the action surface adequately but leaves return values, error behavior, and list pagination or scoping unspecified. It is minimally sufficient to call correctly, not sufficient to predict results.

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 high (89%) and every parameter already carries an inline description, so the baseline is 3. The description's action-to-parameter mapping (command/args/cwd for create, cols/rows for update resize) restates what the schema already says and adds no format or constraint detail beyond it.

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?

The description names a concrete resource (terminal/PTY sessions) and enumerates the five operations the single tool multiplexes: list, create, get, update, remove. An agent can determine what the call does and which action value to use without inspecting siblings, though the generic verb 'Manage' means the differentiation from opencode_session rests mostly on the 'PTY' qualifier rather than an explicit contrast.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Per-action parameter hints ('create (new terminal with command/args/cwd)', 'update (resize or rename)') give implied guidance on how to select an action, and the note to skip 'connect' is a useful exclusion. However, there is no statement of when to prefer this tool over related siblings such as opencode_session, nor any prerequisites or state assumptions.

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