Skip to main content
Glama

serial_wait_for

Read-onlyIdempotent

Block until a serial line matches a custom regex or built-in event (error, boot, panic), then return the match with preceding context. Eliminates polling when watching boot logs.

Instructions

Block until a line matches a custom regex ('pattern') and/or built-in event presets ('events': error/hardfault/assert/panic/boot), then return once with the hit and preceding context. Ideal for watching boot logs without polling.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portNoSerial port name, e.g. COM5 or /dev/ttyUSB0
eventsNoBuilt-in event presets to watch
patternNoCustom regular expression
timeout_msNoGive up after this long (default 30000)
context_linesNoLines of context before the match (default 5)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, covering the safety profile. The description adds useful behavioral details beyond those annotations: it blocks until a match, returns only once, and includes preceding context. This is relevant context that helps an agent understand execution semantics, especially the blocking and one-shot return behavior.

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 two sentences with no redundant phrases. It front-loads the primary purpose (blocking) and then succinctly lists the two matching modes and a typical use case. Every sentence earns its place and is directly informative.

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?

For a blocking read tool with 5 optional parameters and no output schema, the description covers the essential behavior (blocking, one-shot return, context lines) and typical use case (watching boot logs). It does not explicitly describe the return format structure or behavior on timeout, but the timeout parameter is documented in the schema. The definition is sufficient for an agent to decide when and how to call it correctly.

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% for all 5 parameters, so the schema already documents each parameter's meaning. The description mentions 'pattern' and 'events' with brief explanations, but does not add meaningful semantics beyond what the schema provides. Baseline 3 is appropriate since the schema does the heavy lifting.

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: 'Block until a line matches...' and explicitly distinguishes itself from polling alternatives with 'without polling.' It also names the two matching mechanisms (custom regex and built-in event presets), making it clear what the tool does and how it differs from the sibling serial_read/serial_search tools.

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 phrase 'Ideal for watching boot logs without polling' gives a clear context for when to use this tool versus polling with other serial tools. However, it does not explicitly name alternatives or state when NOT to use it, leaving some inference to the agent. The guidance is present but not exhaustive.

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