Skip to main content
Glama

Select USB/Serial port

connect_serial
Idempotent

Auto-selects a USB-C Web Serial port and returns its metadata plus the BLE-connected board it belongs to. Use it for USB flash (rescue flasher) features only; it opens nothing on the board.

Instructions

Ask the app's main process to auto-select a Web Serial (USB-C) port (window.electron.ipcRenderer.autoSelectSerialPort, strategy "first") and return its metadata plus the BLE-connected board it belongs to (USB serial number = chip MAC, matched against each board's GET_DEVICE_WIFI_MAC). In this app the serial link only serves the USB flash (rescue flasher) feature — config, pairing, upgrades and every other device tool go over Bluetooth, so this does not make a board usable by the other tools. Opens nothing on the board.

Input Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4.6/5.0
Behavior4/5

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

With annotations already declaring readOnlyHint=false, idempotentHint=true and destructiveHint=false, the description adds real meaning: it clarifies that the mutation is only app-side port selection ('Opens nothing on the board'), and explains the board-matching rule (USB serial number = chip MAC, matched against GET_DEVICE_WIFI_MAC). It stops short of covering what happens when no port is found, but the safety profile is well resolved.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the action and mechanism, then the return value, then the critical scope caveat — no filler sentences. It is dense and long-ish per sentence (function names inline), but every clause carries selection-relevant information.

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?

No output schema exists, so the description's explanation of the return (port metadata plus the associated BLE-connected board) is necessary and present. Combined with the explicit non-effect on the board and the scoping to the flasher feature, an agent has everything needed to call and interpret it.

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

Parameters4/5

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

The schema has zero parameters and 100% description coverage, so there is nothing parameter-level for the description to compensate for; baseline is 4. The description does note that selection is automatic with strategy "first", which explains why no arguments are needed.

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 (auto-select) and a specific resource (Web Serial / USB-C port) and adds the exact IPC mechanism used (window.electron.ipcRenderer.autoSelectSerialPort, strategy "first"). It is clearly separable from siblings connect_bluetooth and connect_scan_ports, and the description also says what it returns.

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?

Explicitly scopes the tool to the USB flash / rescue flasher feature and states the exclusion: config, pairing, upgrades and every other device tool go over Bluetooth, and this does not make a board usable by other tools. That is exactly the when-to-use / when-not-to-use routing an agent needs against connect_bluetooth.

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