Skip to main content
Glama

expect

Automate serial device login and multi-step command sequences by sending inputs and waiting for expected prompts in a single scripted call.

Instructions

Run a scripted sequence of send-and-wait steps in one call, like expect.

Use it for login flows and multi-step commands instead of one tool call per line: [{send: "", expect: "login: "}, {send: "admin", expect: "Password:"}, {send: "", expect: "> "}, {send: "show version", expect: "> "}]. Each step's output is returned. A step with no send just waits; one with no expect just sends.

Args: steps: The steps, in order. auto_reply: Triggers answered automatically while waiting, e.g. {"--More--": " "}. stop_on_timeout: Stop at the first step whose expect isn't seen. connection: Which open connection (name). Default: the current one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stepsYes
auto_replyNo
connectionNo
stop_on_timeoutNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.2

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral disclosure burden. It explains what each step does, that each step's output is returned, how no-send/no-expect steps behave, and what auto_reply and stop_on_timeout do. It does not cover failure/error behavior or side-effect safety, but the core interaction model is transparent.

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 and economical: purpose first, a compact illustrative example, then clear imperative notes on step semantics followed by an Args list. Every sentence adds useful information without 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?

The description covers the main usage scenario, step structure, parameter semantics, and defaults, while the schema handles nested field details and an output schema exists for return values. Minor gaps remain: behavior when stop_on_timeout is false and how failures are surfaced to the agent.

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?

Top-level schema coverage is 0%, and the description compensates by explaining all four top-level parameters, including defaults and a concrete JSON example. Nested step fields are left to the schema, which already provides descriptions for them.

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 states a specific verb and resource: 'Run a scripted sequence of send-and-wait steps in one call.' It also distinguishes the tool from one-call-per-line approaches and from siblings like send_text/read_until_prompt by framing it as a batched, scripted flow.

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 explicitly says to use this for 'login flows and multi-step commands instead of one tool call per line,' which gives clear context for when it applies. It does not name alternative sibling tools explicitly or state when not to use it, so it stops short of full exclusion guidance.

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