Skip to main content
Glama

Serial Open

serial_open
Destructive

Open a PlatformIO device monitor session on a serial port to capture device output; returns a session ID for reads and closing, and holds the port until closed.

Instructions

Open a pio device monitor session reading from port.

Needs PlatformIO and MESHTASTIC_FIRMWARE_ROOT. The session holds the port until serial_close, so the admin tools cannot use it meanwhile. Returns {session_id, resolved_baud, resolved_filters, env}: the session_id for serial_read / serial_close, plus the baud and filters pio resolved.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "port": "<port>"
    },
    "name": "serial_open"
  }
}

Input Schema

NameRequiredDescriptionDefault
envNoA PlatformIO env whose `monitor_speed` and `monitor_filters` pio takes from platformio.ini, which turns on the ESP32 exception decoders for firmware debugging.
baudNoLine speed, used without `env`.
portYesThe serial port to read.
filtersNoMonitor filters, used without `env`: default ["direct"]; others are time, hexlify, esp32_exception_decoder, esp32_c3_exception_decoder, log2file.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false, openWorldHint=true and non-idempotent, and the description adds the reason: the session monopolizes the serial port and blocks the admin tools until `serial_close`. It also discloses external dependencies (PlatformIO, env var) that annotations cannot express. It does not say what happens if a session is already open or how to recover from a stale one.

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?

Four short sentences, front-loaded with the core action, then prerequisites, then the exclusivity caveat, then the return shape. Every sentence carries information, though the return-value sentence partly duplicates the output schema.

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 session-opening tool with a rich output schema, the description covers the prerequisites, the exclusive port hold, and the handoff to read/close tools — everything an agent needs to invoke it correctly and not collide with other serial operations.

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 `port`, `baud`, `filters` and the `env`-vs-explicit precedence ('used without `env`'). The description reinforces the resolution outcome via `resolved_baud`/`resolved_filters`, but adds no new syntax or defaults beyond what the schema states; 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?

States a specific verb and resource: opens a `pio device monitor` session on `port`. It also distinguishes itself from the siblings it hands off to (`serial_read`, `serial_close`), so an agent can tell what this tool does and where the session lifecycle continues without opening the schema.

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?

Gives clear preconditions (PlatformIO installed, `MESHTASTIC_FIRMWARE_ROOT` set) and an explicit usage constraint: the port is held until `serial_close`, so admin tools cannot use it meanwhile. It stops short of naming a full when-not/alternative decision, but the sibling handoff to `serial_read`/`serial_close` makes the intended workflow unambiguous.

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