Skip to main content
Glama

Write To Session

exec_write

Send base64 data to a session's stdin, optionally closing it with eof. Use for interactive programs started by exec_start.

Instructions

Write bytes to session stdin; eof=true closes stdin afterwards. For interactive programs started by exec_start.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eofNoClose stdin after writing (default false).
data_b64YesStandard base64 of bytes for stdin; may be empty.
session_idYesPositive id from exec_start.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
eofNo
bytesNo
errorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false and destructiveHint=false, so the mutation profile is covered. The description adds the eof side effect (closing stdin) and the interactive-program scope, but says nothing about blocking behavior when the stdin buffer is full or what happens if the session has already exited.

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?

Two compact sentences, front-loaded with the action and immediately followed by the scoping condition. Every clause earns its place.

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?

An output schema exists, so return values need no explanation, and the description covers purpose, target session type, and the eof side effect. It leaves a few operational gaps (buffer-full/blocking behavior, session-state requirements) that an agent might want to know.

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% and all three parameters are documented there, including eof semantics and data_b64 format. The description restates the eof behavior but adds no encoding, size-limit, or session-state detail beyond the schema.

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 ('Write bytes to session stdin') with a precise target ('session stdin'), and immediately ties the tool to sessions created by exec_start, distinguishing it from the sibling write_file which writes to files.

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 clause 'For interactive programs started by exec_start' gives clear context for when this tool applies, but it does not name an alternative or state when-not to use it (e.g., use exec_shell for one-shot commands).

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