Skip to main content
Glama

write

Send raw bytes or text to a serial device without waiting for a reply. Use for one-way commands to Arduinos, ESP32s, or RS-232 instruments, with optional hex encoding and custom newline.

Instructions

Send raw bytes without waiting for a reply (use query for request/response).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesText to send, or a hex string when as_hex=true.
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://.
as_hexNoTreat `data` as hex bytes ('01 A0 FF'); newline is not appended.
newlineNoAppended after text data. Use '\r\n' for CRLF devices, '' for none.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
bytes_writtenYes
Behavior3/5

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

With no annotations, the description carries the full transparency burden. It does disclose the key trait that write does not wait for a reply, but it omits other important details such as requiring the port to be open, whether transmission is immediate, what happens on failure, and whether any output is produced.

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?

A single sentence with no redundant words; the core behavior and the routing alternative are front-loaded. Every part of the sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The schema and output schema cover the parameter mechanics and return shape, and the description covers the fire-and-forget mode. However, for a hardware write operation with no annotations, a prerequisite such as 'open the port first' is missing, and error conditions are not addressed.

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 schema already documents all four parameters. The description adds no parameter-level detail beyond framing the payload as raw bytes, so it stays at the baseline of 3.

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 concrete operation: 'Send raw bytes' with an explicit no-reply mode, and it distinguishes itself from 'query' in the same sentence. Even though the serial-port object is not named directly, the sibling set and port schema make the resource unambiguous.

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 gives a clear when-to-use rule: use write when no reply is expected, and use query for request/response. This is direct routing guidance to one of the most relevant sibling tools.

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