Skip to main content
Glama

pio_upload

Build and flash firmware to a connected board via PlatformIO. Specify an upload port for multi-board setups, or close active serial monitor sessions to free the port before uploading.

Instructions

Build and flash firmware to the connected board (pio run -t upload). Refuses while a serial monitor session holds the port unless stop_open_sessions=true, which closes our own session(s) first. Pass upload_port when several boards are attached. Port failures come back classified (port_busy, port_permission, port_missing, no_response) with a port_diagnosis naming the holder and the fix. Blocked when PLATFORMIO_MCP_POLICY is build_only or read_only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
envNo
project_dirNo
upload_portNo
stop_open_sessionsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.2.0
    • addedInput schema / properties / stop_open_sessions
      Added value: +{
      +  "default": false,
      +  "title": "Stop Open Sessions",
      +  "type": "boolean"
      +}
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so thoroughly. It discloses refusal behavior when a serial monitor holds the port, the effect of stop_open_sessions, classified port failure modes (port_busy, port_permission, port_missing, no_response), and policy-based blocking under PLATFORMIO_MCP_POLICY. This gives the agent a strong model of side effects and error behavior.

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 compact and front-loaded, opening with the core action and command before moving to edge cases and policy. Every sentence adds distinctive information—contention handling, multi-board guidance, error classification, and blocking conditions—with no filler or repetition.

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?

Given the tool's moderate complexity and the presence of an output schema, the description is complete for agent selection and invocation. It covers the main action, prerequisites/conditions, parameter guidance for the tricky cases, error taxonomy, and policy restrictions. The only minor gap is env/project_dir, but their optional defaults and common meaning reduce the risk.

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 0%, so the description must compensate for the schema's silence. It does explain upload_port and stop_open_sessions meaningfully, but it never mentions env or project_dir, leaving two of four parameters undocumented in both schema and description. Partial compensation only.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Build and flash firmware to the connected board') and gives the precise underlying command (`pio run -t upload`), which differentiates it from plain pio_build and pio_upload_ota. It does not explicitly name or contrast sibling tools, but the command and 'connected board' wording make the intent unambiguous.

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 provides concrete usage context: it warns about port contention, explains when to set stop_open_sessions=true, and tells the agent to pass upload_port when multiple boards are attached. It stops short of explicitly naming alternative tools or saying 'use X instead', but the situational guidance is clear and actionable.

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