Skip to main content
Glama
almahdi
by almahdi

pty_kill

Destructive

Terminate pseudo-terminal sessions in the PTY MCP Server. Kill running sessions while optionally preserving output buffers for log comparison or removing them entirely to free resources.

Instructions

Terminates a PTY session and optionally cleans up its buffer.

Behavior:

  • If the session is running, it will be killed (status becomes "killed")

  • If cleanup=false (default), the session remains in the list with its output buffer intact

  • If cleanup=true, the session is removed entirely and the buffer is freed

  • Keeping sessions without cleanup allows you to compare logs between runs

Use cleanup=false if you might want to read the output later. Use cleanup=true when you're done with the session entirely.

To send Ctrl+C instead of killing, use pty_write with data="\x03"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe PTY session ID (from pty_spawn)
cleanupNoRemove session and free buffer (default: false)
Behavior5/5

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

The description adds significant behavioral context beyond annotations: it explains the status change to 'killed', the buffer retention/cleanup behavior, and the purpose of keeping sessions for log comparison. While annotations indicate destructiveHint=true, the description elaborates on what gets destroyed and under what conditions, providing valuable operational details.

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 with clear sections (Behavior, usage advice), front-loaded with the core purpose, and every sentence adds value without redundancy. The alternative tool mention is appropriately brief and directly relevant.

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

Completeness5/5

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

Given the tool's complexity (destructive operation with behavioral nuances), rich annotations, and no output schema, the description provides complete context: it covers purpose, detailed behavior, parameter implications, usage guidelines, and alternatives. No significant gaps remain for agent understanding.

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?

With 100% schema description coverage, the baseline is 3. The description adds meaningful context about parameter semantics: it explains the default behavior (cleanup=false), the implications of cleanup=true (removes session entirely and frees buffer), and ties parameter choices to usage scenarios (e.g., 'Use cleanup=false if you might want to read the output later'). This goes beyond the schema's basic 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?

The description clearly states the specific action ('Terminates a PTY session') and resource ('PTY session'), distinguishing it from siblings like pty_write (for sending signals) and pty_list/pty_read (for inspection). The title being null doesn't affect this clarity.

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?

The description provides explicit guidance on when to use this tool versus alternatives: it specifies to use cleanup=false for potential future output reading and cleanup=true for complete removal, and explicitly names pty_write as an alternative for sending Ctrl+C instead of killing. This covers both when/when-not scenarios and alternatives.

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