Skip to main content
Glama

Write To Session

write_to_session

Sends text to a running PTY session's stdin, optionally appending Enter, so you can interact with an active shell from MCP.

Instructions

Write input to a PTY session's stdin.

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": {
      "session_id": "<session_id>",
      "text": "<text>"
    },
    "name": "write_to_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYestext to send
session_idYesid from start_shell_session
press_enterNoappend a newline (like pressing Enter)

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden and does not meet it. It does not say whether the write blocks until the process consumes input, whether a newline is required, whether output must be read separately with read_session_output, or what happens if session_id is invalid or the session is closed.

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?

A single front-loaded sentence with no filler. It is efficient, though the terseness borders on under-specification for a tool that mutates a live terminal session.

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?

The tool is simple, the input schema is fully documented, and an output schema exists, so the description need not cover return values. However, given zero annotation coverage on an action that injects input into a running process, the omission of prerequisite and interaction-with-read_session_output context leaves a meaningful gap.

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 coverage is 100% and every parameter, including the press_enter default, is documented in the schema itself. The description adds no meaning beyond that, so the baseline of 3 applies.

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 states a specific verb and resource: writing input to a PTY session's stdin. That is unambiguous about what the tool does, but it makes no attempt to distinguish itself from adjacent session tools such as read_session_output or start_shell_session.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no prerequisite (e.g. that a session must already exist via start_shell_session), and no mention of alternatives. The only hint that a session is required lives in the schema's session_id description, not in the tool description.

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

Deploy Server

Other Tools