Skip to main content
Glama

close_port

Close an active serial port and release it for other programs. Call this when finished communicating to free the device.

Instructions

Close a port opened with open_port and release it for other programs.

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?

No annotations are present, so the description carries the burden. It discloses the main side effect — closing the port and releasing it for other programs — but is silent on failure modes, such as closing an already-closed or never-opened port, and on whether buffered data is flushed. The core behavior is clear, yet edge behavior is uncovered.

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 verb and resource, with every clause earning its place: 'opened with open_port' scopes it, and 'release it for other programs' explains the why. No fluff.

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 low complexity (one required parameter, 100% schema coverage, output schema present), the description covers the tool's role and effect adequately. The only missing piece is error behavior, which is minor for such a simple companion 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%, so the port parameter is already fully documented with examples and URL variants. The description adds no parameter-level detail, and at full coverage the baseline of 3 applies.

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 ('close') and resource ('a port opened with open_port'), plus the purpose ('release it for other programs'). This clearly inverts open_port and stays distinct from read/write/port_status siblings.

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 phrasing 'opened with open_port' supplies clear context: it applies to a port previously opened by its counterpart tool. It doesn't enumerate exclusion conditions or list alternative tools, but the pairing with open_port leaves little ambiguity about when to call it.

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