Skip to main content
Glama
dwgx

SmartCLI

by dwgx

wait_regex

Read-onlyIdempotent

Wait for a specific regex pattern to appear on the terminal screen, then capture a snapshot. Enables precise synchronization instead of using blind delays.

Instructions

Block until pattern (a regex) appears on screen, then snapshot.

Returns {"ok", "matched", "alive", "text", "json"}. Timeout is not an error: the call returns ok=true with matched=false plus the final screen snapshot. Screen lines are right-padded with spaces — end-anchored patterns never match; use unanchored markers. This is the readiness sync — prefer it over a blind delay after send_line/send_keys.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sidYes
patternYes
timeout_msNo
Behavior5/5

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

Beyond the annotations (readOnlyHint, idempotentHint, destructiveHint), the description discloses critical behavioral traits: timeout returns ok=true with matched=false, screen lines are right-padded causing end-anchored patterns to never match, and it lists the exact return fields (ok, matched, alive, text, json). This is valuable context for an agent's decision-making.

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 concise and front-loaded: purpose in the first line, then essential return info and caveats. No filler words; every sentence adds value, from the timeout behavior to the padding trap to the usability recommendation.

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 lacking an output schema, the description provides a complete picture for effective use: return keys, timeout handling, regex padding pitfall, and when to prefer this over a delay. This is sufficient for an agent to select and invoke the tool correctly in most contexts.

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 description explains `pattern` as a regex to match on screen and describes the timeout semantics (not an error, returns final snapshot). However, `sid` (session ID) is not explained, and the schema already gives names and types. With 0% schema coverage, the description partially compensates by clarifying two of the three parameters.

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 opens with a specific verb-resource pair: "Block until `pattern` (a regex) appears on screen, then snapshot." This clearly distinguishes it from siblings like wait_change and wait_visual_change by focusing on regex-based screen matching, and the phrase "the readiness sync" reinforces its distinct role.

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 explicitly says "This is the readiness sync — prefer it over a blind delay after send_line/send_keys," giving direct guidance on when to use this tool instead of a naive delay. The timeout behavior ("Timeout is not an error") also helps agents handle non-matching cases correctly.

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/dwgx/SmartCLI'

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