Skip to main content
Glama

write_input

Sends text input to a specific iTerm2 session, pressing Enter by default, to drive shells, REPLs, TUIs, or answer interactive prompts in a chosen pane.

Instructions

PREFER SendMessage when the target is another Claude Code session. SendMessage delivers an addressed, queued message straight into that session's conversation; it does not depend on which pane has focus, does not race whatever the session is mid-way through, and is not silently swallowed if the session is busy. Reach for write_input only for terminal work SendMessage cannot do: driving a shell, REPL or TUI, answering an interactive prompt, or starting a program in a pane. Send text input to a specific iTerm2 session. By default presses Enter after the text. When sending to a Claude Code session anyway, set submit: true — this writes the text without a trailing newline, then sends a separate Enter keystroke to trigger submission (Claude Code buffers pasted text and needs a distinct Enter to submit).

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_input"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe text to send to the terminal
submitNoSet true when sending to a Claude Code prompt. Writes the text without newline first, then sends a separate Enter to trigger submission.
newlineNoPress Enter after the text (default: true)
session_idYesThe unique session ID (UUID) from list_sessions

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.3/5.0
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: it discloses the default trailing Enter, the special submit:true path (write text without newline, then send a separate Enter), and Claude Code's pasted-text buffering quirk. It does not cover failure behavior for an invalid or stale session_id, which is the main remaining gap.

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?

The guidance is front-loaded and every sentence is functional, but the SendMessage comparison is stretched across a long clause list ('does not depend on which pane has focus, does not race..., and is not silently swallowed'), and the core purpose statement arrives only after that preamble.

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 mutation tool with no annotations and no output schema, the definition covers the key questions: what it does, what the default keystroke behavior is, and how submit differs. It stops short of describing what the call returns or how session_id errors surface.

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 100%, so all four parameters are already documented, and the description's explanation of submit largely restates the schema's own wording. It adds a little operational context around why submit exists, but the baseline 3 is the right level here.

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 names a concrete verb and resource: 'Send text input to a specific iTerm2 session', and adds the default behavior of pressing Enter. It also explicitly separates the tool from SendMessage, so an agent can tell which one to pick without inspecting schemas.

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?

It gives explicit when-to-use guidance ('driving a shell, REPL or TUI, answering an interactive prompt, or starting a program in a pane') and an explicit when-not-to-use route ('PREFER SendMessage when the target is another Claude Code session'), reinforced with reasons.

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