Skip to main content
Glama

read_until

Read serial data until a specific pattern like 'OK' or 'ready>' arrives, returning the full response including the pattern. If timeout occurs, returns any data received with matched=false.

Instructions

Wait until a pattern appears (e.g. 'OK', 'ready>', 'Temperature:') and return everything up to and including it. On timeout returns whatever arrived, with matched=false.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portYesPort device from list_ports (e.g. /dev/cu.usbserial-0001, /dev/ttyUSB0, COM3), or a pyserial URL such as socket://host:port, rfc2217://host:port or loop://.
regexNoInterpret `pattern` as a Python regex.
patternYesSubstring to wait for, or a regex when regex=true.
timeout_sNoGive up after this many seconds.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
bytesYes
errorNo
matchedYesFalse if the timeout expired before the pattern appeared.
elapsed_sYes
Behavior4/5

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

No annotations are provided, so the description carries the behavioral disclosure burden. It meaningfully discloses the blocking-until-pattern behavior and the timeout contract ('returns whatever arrived, with matched=false'). It omits edge cases like an unopened port or buffer consumption, but the core runtime behavior is well covered.

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?

Two sentences, front-loaded with the core wait-and-return behavior and closed with the timeout contract. Every clause adds useful information and there is no filler.

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?

Essential behavior is fully described: what it waits for, what it returns, and what happens on timeout. It does not mention prerequisites such as an already-open port, but the port parameter and sibling tools like open_port/port_status make that context available.

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?

The input schema covers 100% of the parameters, so the baseline is 3. The description adds only pattern examples and does not explain port, regex, or timeout semantics beyond what the schema already states. This is adequate but not enhanced.

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 ('Wait') and a concrete resource ('until a pattern appears'), then defines the return as 'everything up to and including it.' It also gives concrete examples of patterns ('OK', 'ready>', 'Temperature:'), making the tool's purpose unmistakable and distinct from a plain read or tail.

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 frames the tool as a blocking, pattern-terminated read and notes the timeout fallback, so an agent knows when this is the right call. It does not explicitly reference sibling alternatives or say when not to use it, but the context is clear enough.

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/HumbertoBernal/mcp-serial'

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