Skip to main content
Glama

open_port

Open a serial connection to a device and start buffering incoming data. Configure communication parameters like baud rate, parity, and stop bits for reliable data exchange.

Instructions

Open a serial port and start buffering everything it sends.

Idempotent: opening an already-open port with the same settings just returns its status; different settings close and reopen it. The port stays open until close_port.

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://.
parityNoN=none, E=even, O=odd, M=mark, S=space.N
baudrateNoBits per second, e.g. 9600, 115200, 921600.
bytesizeNoData bits: 5, 6, 7 or 8.
encodingNoText encoding used to decode/encode data (utf-8, latin-1, ascii...).utf-8
stopbitsNo1, 1.5 or 2.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
portYes
errorNoSet when the device disconnected or failed.
parityYes
baudrateYes
bytes_rxYes
bytes_txYes
bytesizeYes
encodingYes
stopbitsYes
uptime_sYes
connectedYes
unread_bytesYesBytes buffered and not yet consumed by read/read_until/query.
dropped_bytesYesBytes discarded because the buffer overflowed.
Behavior5/5

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

With no annotations, the description carries full behavioral disclosure, and it delivers: idempotency, reopen-on-different-settings, status return, buffering, and persistence until close_port are all stated explicitly.

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?

Three compact sentences front-load the core operation, then add the idempotency and lifecycle caveats. No filler or repetition.

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?

For a stateful open operation with a fully self-documenting schema and an output schema, this is complete: the agent knows what it does, when it is safe to call again, and how the port lifecycle ends. Nothing needed to call it correctly is missing.

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 six parameters. The description adds no parameter-specific detail beyond the generic phrase 'same settings,' so the baseline 3 is appropriate.

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 operation (open a serial port) and the resource, and immediately states the consequence (start buffering everything it sends). This cleanly separates it from siblings like close_port, port_status, and write.

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?

It gives clear lifecycle context: the port remains open until close_port, and an already-open port with different settings is closed and reopened. It doesn't explicitly list when not to use it or name alternatives, but the intended use is unambiguous.

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