Skip to main content
Glama

session_wait

Block until an interactive Claude Code session finishes its pending work and retrieve the final response. Supports timeouts with partial results, resumable without losing progress, and optional auto-compact.

Instructions

Block until the session finishes its pending work, then return the answer.

This is the completion trigger: it returns Claude's final response as the tool result.

Resumable. If timeout (seconds, max 3600) elapses while Claude is still working, this returns timed_out: true with the partial transcript and keeps the pending dispatch — just call it again. Nothing is lost.

Set auto_compact_at (e.g. 70) to run /compact automatically when context usage crosses that percentage after the turn completes.

Returns {response, state, timed_out, baseline, elapsed_s, steers}. baseline: "lost" means this server restarted since the prompt was sent, so response is a plain tail of the pane rather than an exact diff. A question field appears when the session stopped on a prompt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
timeoutNo
auto_compact_atNo
Behavior5/5

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

With no annotations provided, the description fully carries the load. It discloses blocking behavior, resumability, timeout semantics, auto_compact behavior, return fields, and even edge cases like baseline lost and question field. This is exemplary transparency.

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?

The description is well-structured with a clear opening purpose, bolded 'Resumable' for key behavior, and concise paragraphs for parameters and return values. Every sentence adds value, and the formatting enhances scannability without unnecessary fluff.

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?

Despite no output schema, the description explains all return fields and edge cases. It covers the tool's complexity (timeout, resumability, auto-compact) and is complete for a blocking wait operation. Given the sibling context, it is fully sufficient.

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?

The schema has 0% description coverage, so the description must compensate. It explains 'timeout' with max 3600 and its timeout behavior, and 'auto_compact_at' with an example and effect. 'name' is not explicitly described, but its purpose is clear from context (session name). Overall, the description adds meaningful semantics beyond the raw 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?

The description clearly states 'Block until the session finishes its pending work, then return the answer' and explicitly calls it 'the completion trigger,' which distinguishes it from sibling tools like session_send or session_tail. The verb 'block' and resource 'session' are specific and unambiguous.

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 description clearly indicates this tool is the completion trigger—implying use after dispatching work—and provides guidance on resumability ('just call it again') and timeout behavior. However, it does not explicitly name alternatives or list scenarios where another tool should be used, so it lacks full exclusionary guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/joschi655/claude-code-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server