Skip to main content
Glama

query

Send a command to a serial device and retrieve its reply in one call. Wait for an expected response or line silence, enabling request/response interactions with AT modems, CLI firmware, and PING-PONG devices.

Instructions

Send a command and return its reply in one call. Best for request/response devices (AT modems, CLI firmware, 'PING' -> 'PONG' sketches).

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 `expect` as a regex.
expectNoReturn as soon as this substring/regex shows up in the reply (e.g. 'OK', '\n'). Omit to collect until the device goes quiet.
commandYesCommand text to send (newline is appended).
newlineNoLine ending appended to the command.
settle_msNoWithout `expect`: stop once the line is silent for this many ms.
timeout_sNoMax seconds to wait for the reply.
clear_firstNoDiscard stale buffered data before sending, so the reply is clean.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
sentYes
bytesYes
errorNo
matchedNoWhether `expect` was seen; null when no `expect` was given.
responseYes
elapsed_sYes
Behavior3/5

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

No annotations are present, so the description carries the burden. It discloses the one-call request/response behavior, but doesn't mention blocking behavior, timeouts, buffer clearing, or potential side effects on the device. It is honest but thin.

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 short sentences with no redundant words. The core action is front-loaded, and the usage guidance follows immediately. Every word earns its place.

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?

Between the 100% schema coverage and the presence of an output schema, the description doesn't need to explain return values. The focus on request/response use provides enough context for correct invocation; the only missing piece is guidance on edge cases or sibling differentiation.

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%, so the individual parameter meanings are already fully documented. The tool description adds no additional parameter-level semantics beyond indicating that a command is sent and a reply returned.

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 names a specific verb and resource: 'Send a command and return its reply in one call.' This clearly distinguishes it from write/read-style siblings, and the request/response examples make its function concrete and unmistakable.

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?

'Best for request/response devices' plus examples like AT modems and PING->PONG gives clear context for when to use it. It doesn't explicitly name alternatives or give when-not-to-use exclusions, so it stops short of a 5.

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