Serial-port capability layer and knowledge format for coding agents
openbaud demonstrates strong naming conventions (verb-first: list_, open, close, read, send, request, run_command, run_workflow, schema, ask_port, show_result) and comprehensive parameter descriptions. All 11 tools have detailed descriptions (100-300+ chars, well above the 10-char minimum). Input schemas are present and properly typed with JSON Schema. Tool annotations (readOnlyHint, destructiveHint, openWorldHint) are correctly applied. However, output schemas are not documented, callers cannot predict response structure. Error handling guidance is minimal; tools do not explain recovery paths or categorize errors as retryable vs fatal. Parameter relationships (e.g., session_id vs port vs device selector resolution) are documented in descriptions but could be clearer. The framing parameter in 'open' uses an object type with a vague description ('One of {delimiter}|{idle_ms}|{length_prefix:...}') rather than a discriminated union, forcing LLMs to guess the correct structure.
Ask the user to pick a serial port from the list. Returns the chosen port path and optional metadata (device name, reason). Carries a UI template.
Close a session and release the port.
List serial ports (USB metadata included) plus the always-available mock:echo loopback.
Open a serial port session. If `device` names a workspace device, its profile supplies transport defaults and framing; explicit arguments override. `port` may be omitted when the device profile declares a `selector` (vid/pid/serial_number/product) — exactly one live match is required. `replay:<capture path>` (relative to the workspace) replays a recorded .obcap. Returns a session_id.
Cursor-based framed read: returns frames received since your previous read (waits up to timeout_ms for the first frame). Reports dropped_bytes if the buffer overflowed.
Send bytes and await the response (audited). `match` decides when the response is complete: {length:N} | {delimiter:"..."} | {idle_ms:N}; default is a 50 ms idle gap.
Output schemas not documented. Callers cannot predict response structure for read, request, run_command, run_workflow, or show_result. LLMs must infer field names and types, risking parsing errors and wasted tokens.
Framing parameter in 'open' uses vague object type with pipe-delimited description instead of discriminated union. LLMs cannot determine valid structure without trial-and-error.
Error handling lacks recovery guidance. Tools do not categorize errors as retryable, user-fixable, or fatal. No examples of error responses or suggested next steps.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 62 | 2025-06-18+ | v2 |
Execute a named command from devices/<device>/commands/ with typed params: builds the frame, awaits the response and classifies the outcome (normal | exception | silence | timeout | checksum_error | malformed) against the command's declared `expect` (audited; an unmet expectation is an error carrying the full result JSON). Give session_id for an open session, or port to open an ephemeral one with the device's profile transport — port may be omitted when the profile declares a selector, and accepts replay:<capture path>. Commands with risk=danger additionally require acknowledge_risk=true.
Execute a workflow from devices/<device>/workflows/: its steps run in order on one session (step params override command defaults); the first failing step skips the rest, then every `finally` step is attempted regardless. Returns {ok, steps, finally, skipped}; ok=false is an error carrying the full result JSON. Workflow risk is the maximum of its commands' risk — danger requires acknowledge_risk=true. Session resolution is the same as run_command (session_id, port, or profile selector).
The authoritative JSON Schema (or, with example=true, an annotated YAML example) of the openbaud knowledge formats — profile, command, workflow. Call this before writing or editing YAML under devices/.
Write raw bytes (audited). Provide exactly one of hex ('01 A0 FF') or text (control chars as-is, e.g. "AT\r\n").
Display a result to the user: a capture, timeline, diagnostics, polar scan, heatmap, or generic JSON. The result is a reference to a file in .openbaud/out/ (or inline for small payloads); the viewer fetches and renders it. Carries a UI template.
send and request tools accept mutually exclusive hex/text parameters but do not explicitly state this constraint in the description. LLMs may pass both, causing ambiguous failures.
Parameter relationships (session_id vs port vs device selector) are documented but scattered across descriptions. A single 'Session Resolution' section in each tool would clarify the precedence and mutual exclusivity.