Skip to main content
Glama

clear_buffer

Clear buffered unread data on a serial port to prevent processing stale messages, while keeping line history for tail.

Instructions

Discard all buffered unread data on a port (line history for tail is kept).

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://.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries the full disclosure burden. It discloses the key behavioral nuance that tail line history is kept and that buffered unread data is discarded, but it does not mention prerequisites (e.g., port must be open) or whether the operation is destructive beyond the buffer.

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 that front-loads the action and immediately provides the relevant caveat about tail history. There is no filler, repetition, or unnecessary detail.

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?

Given the simple one-parameter shape, an output schema for return values, and a clear description, the definition is nearly complete. It covers the core behavior and the tail interaction. The only minor gap is not stating that the port must be open, but this is low-risk for such a simple tool.

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% and the port parameter is thoroughly described in the schema with examples and accepted URL formats. The description adds no additional parameter semantics, so a baseline score of 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?

States a specific verb ('Discard') and resource ('buffered unread data on a port'), and adds a clarifying caveat that tail line history is kept, which helps distinguish it from reset_device or close_port. The action is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage: use this when you want to discard buffered unread data. However, it provides no explicit when-to-use guidance, no exclusions, and no comparison with sibling tools such as reset_device or read. The context is clear but entirely implied.

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