Skip to main content
Glama

pio_flash_and_verify

Build and flash firmware to a connected board, then monitor the boot log to verify it starts correctly. Passes when an expected log line appears, fails on crash patterns, and times out if no match occurs.

Instructions

Hardware-in-the-loop check with no human: build + flash (pio run -t upload), then open the serial port and watch the boot log until expect (regex) matches -> verdict pass, or fail_on matches -> verdict fail with the crash automatically decoded to file:line, or timeout_s elapses -> verdict timeout. Port and baud come from platformio.ini (monitor_port/monitor_speed) or the single detected board. Set expect to a line your firmware prints once it is healthy, e.g. 'WiFi connected'. Blocked under build_only/read_only policy.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
envNo
baudNo
expectNosetup done|ready|started|Booting|loop
fail_onNoGuru Meditation|panic'ed|abort\(\) was called|assert failed|HardFault|Hard Fault|BusFault|UsageFault|MemManage|stack overflow|Task watchdog|Brownout|CORRUPT HEAP|Backtrace:|rst:0x[0-9a-f]+ \((?:SW_CPU_RESET|TG\dWDT_SYS_RESET|RTCWDT_RTC_RESET|PANIC)
settle_sNo
max_linesNo
timeout_sNo
project_dirNo
upload_portNo
monitor_portNo
stop_open_sessionsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and largely succeeds: it discloses the build+flash side effect, serial port monitoring, regex-based verdicts, crash decoding, port/baud resolution, and policy blocking. Minor gaps remain around behavior such as stop_open_sessions and potential conflicts with existing monitor sessions, but the core behavioral contract is well exposed.

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?

The description is dense but every sentence earns its place: the workflow, regex verdicts, crash decoding, configuration source, practical expect guidance, and policy restriction are all communicated without filler. It is front-loaded with the tool's core identity and reads efficiently despite the complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the primary pipeline and verdicts well, and an output schema exists to document return values. However, the tool is complex and has no annotations, and several auxiliary parameters and edge behaviors are left unexplained. It is adequate for selecting the tool but not fully complete for invoking it with all options correctly.

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 there are 11 parameters, so the description must compensate heavily. It explains expect, fail_on, timeout_s, and baud/port selection, but leaves env, project_dir, settle_s, max_lines, upload_port, monitor_port, and stop_open_sessions without meaningful narrative meaning. Several optional parameters remain ambiguous despite being important to invocation.

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, differentiated purpose: a no-human hardware-in-the-loop check that builds, flashes, watches serial output, and reaches a pass/fail/timeout verdict. It clearly separates this from sibling tools like pio_build, pio_upload, and pio_monitor_start by describing the integrated workflow and the verdict semantics.

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 description gives clear context for when to use the tool: it is a hardware-in-the-loop verification with no human, and it even advises the agent to set expect to a line the firmware prints when healthy. It does not explicitly name alternatives or exclusion conditions, but the context is strong enough for an agent to recognize the appropriate use case.

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