Skip to main content
Glama

Message a Claude Code session

send_message

Sends a message to a Claude Code session, live or headless, and optionally waits up to 45 seconds for the reply so you can get an answer in one call.

Instructions

Send a message to a Claude Code session, live or headless. A connected live window gets it within seconds. A headless session answers in its next turn. Give wait_seconds to get the answer in this call.

Input Schema

NameRequiredDescriptionDefault
textYesThe message.
session_idYesThe id from list_sessions or start_session.
wait_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare this is a non-read-only, non-destructive, non-idempotent write. The description adds genuine behavioral context beyond that: live windows receive within seconds, headless sessions answer on their next turn, and the call can be made synchronous via wait_seconds. It does not cover failure behavior for an invalid or ended session_id, which is the 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.

Conciseness5/5

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

Four short sentences, purpose front-loaded, followed by the mode-specific delivery semantics and the wait_seconds opt-in. No filler or repetition.

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?

With no output schema, the description implies what comes back when wait_seconds is set ('the answer in this call'), covering the return behavior adequately. Missing only error/edge handling for unknown or terminated sessions, which for a 3-parameter tool is a minor gap.

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 67%, with text and session_id already documented (including where the id comes from). The description compensates for the undocumented wait_seconds by explaining its purpose — blocking to receive the answer — which the schema only bounds numerically (0-45).

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 (send) and resource (a message to a Claude Code session) and names the two target modes, live and headless. An agent can distinguish this from read_messages or send_job without opening the schema.

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?

Explains the two operating modes and when wait_seconds is appropriate ('to get the answer in this call'), giving clear context for invocation. It stops short of naming alternatives such as send_job or stating exclusions, so no explicit when-not guidance.

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