Skip to main content
Glama

session_write

Destructive

Send text input to an owned running terminal session's stdin. Include a newline to submit answers or commands, then read the session output to observe the response.

Instructions

Send text to the stdin of an owned running terminal session. Include a newline (for example, "yes\n") to submit an answer or command. Input can trigger destructive operations and may be echoed in session output, including secrets; only send input the user authorized. accepted=true confirms the input was sent to the device connection, not that the program consumed it or completed an action. Use session_read afterward to observe the response. Repeating a write sends the input again, so do not retry blindly. Unknown, unauthorized or ended sessions are errors. This does not start a session or cancel it; use session_start or session_stop for those operations.

Input Schema

NameRequiredDescriptionDefault
inputYesInput bytes as text, e.g. yes\n
session_idYesSession identifier
client_tokenYesTarget client connection token, required with management access (including stdio and no-password mode). Device-scoped bearer access implicitly selects its own token.

Output Schema

NameRequiredDescriptionDefault
acceptedYesWhether the action was sent to the device connection; this does not confirm it was consumed or completed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.3.1-stdio.2
    • changedInput schema / properties / client_token / description
      Previous value: -"Target client connection token (required when authenticated with the management key)"New value: +"Target client connection token, required with management access (including stdio and no-password mode). Device-scoped bearer access implicitly selects its own token."
    • changedOutput schema / additionalProperties
      Previous value: -trueNew value: +false
    • addedOutput schema / properties
      Added value: +{
      +  "accepted": {
      +    "description": "Whether the action was sent to the device connection; this does not confirm it was consumed or completed.",
      +    "type": "boolean"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "accepted"
      +]
  2. First observedv0.3.1-stdio.1

TDQS

A4.6/5.0
Behavior4/5

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

Adds substantial context beyond the destructive/non-idempotent annotations: that input can trigger destructive operations, that input may be echoed in output including secrets, that repeating a write resends input, and that unknown/ended sessions error. The key disclosure that accepted=true only means the input reached the device connection, not that the program consumed it, is genuinely useful and not derivable from annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Long but front-loaded: the core action comes first, then caveats, then lifecycle exclusions. Nearly every sentence carries a distinct rule, though the secrets/echo warning and the accepted=true caveat could be tightened slightly.

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?

An output schema exists, yet the description still clarifies what the accepted flag does and does not confirm, and covers authorization, error conditions, and follow-up reads. Nothing an agent needs before calling this destructive tool is missing.

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 the baseline is 3. The description still adds real semantics by explaining that a newline is what submits a command or answer, which is behavioral meaning the schema's 'Input bytes as text, e.g. yes\n' only implies.

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?

States a specific verb and resource: send text to the stdin of an owned running terminal session. It also fences itself off from siblings by naming session_start and session_stop and by pointing to session_read for observing output.

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?

Gives explicit routing: use session_read afterward to observe the response, and use session_start/session_stop for lifecycle operations since this tool does not start or cancel a session. It even covers the retry case ('do not retry blindly') and the error case for unknown or ended sessions.

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