Skip to main content
Glama
slepp
by slepp

ssh_write_session

Write commands or control sequences to an SSH session's PTY. End with newline to press Enter, set wait_seconds to capture output, and drain remaining output via ssh_read_session.

Instructions

Write text or a control sequence to a tracked SSH session PTY. Always terminate commands with a trailing newline (\n) to submit them. Control characters: \u0003 for Ctrl-C, \u0004 for Ctrl-D, \u001a for Ctrl-Z. Use wait_seconds (e.g. 1-5) to receive the command response in the same call. Check 'pending_output_chars' in the response; if non-zero, call ssh_read_session to drain.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesRaw text to write to the session PTY. Include '\n' to press Enter. Control characters work: '\u0003' for Ctrl-C, '\u0004' for Ctrl-D. Text is written exactly as provided.
session_idYes
wait_secondsNoSeconds to wait for output after writing. Default: 1.0.
max_output_charsNo
Behavior4/5

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

With no annotations, the description carries the full burden and does well by disclosing control-character encoding, newline behavior, and the response field pending_output_chars. It explains how writes should be submitted and how to drain output, but it does not mention error cases or invalid session handling, leaving some gaps.

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, each earning its place: the write action, newline/control characters, and the wait/drain workflow. There is no redundancy with the schema, and the information is front-loaded and directly actionable.

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 four-parameter tool with no output schema and no annotations, the description covers the essential workflow: how to write, what to expect (pending_output_chars), and when to call ssh_read_session. It omits max_output_chars semantics, but the operational flow is adequately specified for effective use.

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?

The schema covers only 50% of parameters (input and wait_seconds), and the description significantly enriches those: control codes, newline requirement, and wait_seconds usage. However, max_output_chars is never mentioned in the description, so one parameter remains underdocumented.

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 uses the specific verb 'Write' and the resource 'tracked SSH session PTY', clearly distinguishing it from siblings like ssh_read_session and ssh_exec. It also states the exact scope (text or control sequence), making the tool's function immediately obvious.

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?

The description gives concrete usage rules: trailing newline to submit, control character mappings, wait_seconds recommendation (1-5), and when to follow up with ssh_read_session based on pending_output_chars. It does not explicitly contrast with ssh_exec, but the interactive PTY context implies the appropriate use case.

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/slepp/ssh-mcp'

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