Skip to main content
Glama

port_in_use_by

Identify which program is holding a serial port on macOS or Linux. Use when a connection fails because the port is busy, or before asking the user to close the conflicting application.

Instructions

Report which program currently holds a serial port (macOS/Linux, via lsof).

Use when connect says the port is in use, or before asking the user to close something. On Windows the OS doesn't expose this; the usual suspects are a terminal (PuTTY), WSJT-X, a logger, or the Arduino Serial Monitor.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.2

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the burden. It usefully reveals that it relies on lsof and that Windows does not support the underlying introspection, but it does not mention potential permission issues, behavior when no process holds the port, or whether the command has side effects. It is adequate but not fully transparent.

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 sentences with no wasted words. The core purpose is front-loaded, usage guidance follows, and the Windows caveat is concise. Every sentence 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?

The tool is simple, has one required parameter, and an output schema is present, so return-value documentation is not the description's responsibility. The missing port-format guidance is a minor gap; overall the context is sufficient for an agent to invoke the tool appropriately.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description only clarifies that the argument is a serial port. It does not provide expected port formats (e.g., /dev/ttyUSB0) or connect it to the output of list_serial_ports. The description adds only marginal meaning beyond the schema's 'Port' title.

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 specific action ('Report which program currently holds a serial port') with a clear resource and platform scope ('macOS/Linux, via lsof'). This is immediately distinguishable from sibling tools like list_serial_ports or connect.

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 explicitly says when to use it: 'Use when connect says the port is in use, or before asking the user to close something.' This is clear contextual guidance, though it does not name alternative tools or explicitly state when not to use the tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.