Skip to main content
Glama

pio_upload_ota

Flashes firmware over Wi-Fi to ESP32/ESP8266 devices running ArduinoOTA, rebuilding first or sending an existing filesystem image. Maps failures to fixes like missing OTA handler or auth errors.

Instructions

Flash firmware over Wi-Fi to an ESP32/ESP8266 running ArduinoOTA (espota). Give host (IP or name.local); port defaults to 3232 (ESP32) / 8266 (ESP8266) and auth is the ArduinoOTA password. By default it resolves and pings the host first, then runs pio run -t upload --upload-port <host> so the image matches the current build; build=false sends the existing .pio/build//firmware.bin with espota.py directly. filesystem=true sends the SPIFFS/LittleFS image instead. Failures are mapped to what to fix: no_response (ArduinoOTA.handle not running), auth_failed, no_callback (firewall), device_rejected (partition table has no OTA slot). Blocked under build_only/read_only policy.

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": {
      "host": "<host>"
    },
    "name": "pio_upload_ota"
  }
}

Input Schema

NameRequiredDescriptionDefault
envNo
authNo
hostYes
portNo
buildNo
llm_modelNoThe model identifier you are running as, for example "claude-opus-4-8" or "gpt-5.2". Pass "unknown" if you are not certain. Recorded for the server developer's analytics.
timeout_sNo
filesystemNo
project_dirNo
conversation_idNoThe conversation_id this server returned earlier in this conversation, unchanged, including after later user messages. Omit it if you have none. Recorded for the server developer's analytics.
verify_reachableNo

Output Schema

NameRequiredDescriptionDefault
_mcp_instructionsNoServer-issued metadata for this conversation.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.9.0
    • removedInput schema / properties / context
      Removed value: -{
      -  "description": "A few words on why you are calling this tool, for the server developer's analytics. Describe people and things by role, such as \"a customer\". Do not quote the user or include names, emails, or other personal details.",
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "host",
      -  "context"
      -]New value: +[
      +  "host"
      +]
  2. Changed5 schema fields changedv0.6.2
    • addedInput schema / properties / context
      Added value: +{
      +  "description": "A few words on why you are calling this tool, for the server developer's analytics. Describe people and things by role, such as \"a customer\". Do not quote the user or include names, emails, or other personal details.",
      +  "type": "string"
      +}
    • addedInput schema / properties / conversation_id
      Added value: +{
      +  "description": "The conversation_id this server returned earlier in this conversation, unchanged, including after later user messages. Omit it if you have none. Recorded for the server developer's analytics.",
      +  "type": "string"
      +}
    • addedInput schema / properties / llm_model
      Added value: +{
      +  "description": "The model identifier you are running as, for example \"claude-opus-4-8\" or \"gpt-5.2\". Pass \"unknown\" if you are not certain. Recorded for the server developer's analytics.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "host"
      -]New value: +[
      +  "host",
      +  "context"
      +]
    • addedOutput schema / properties
      Added value: +{
      +  "_mcp_instructions": {
      +    "description": "Server-issued metadata for this conversation.",
      +    "properties": {
      +      "conversation_id": {
      +        "description": "The server-issued conversation identifier.",
      +        "type": "string"
      +      }
      +    },
      +    "type": "object"
      +  }
      +}
  3. Addedv0.2.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 burden and does so well: it discloses the pre-flight reachability check (verify_reachable default), the exact command executed, and a failure taxonomy mapped to fixes (no_response, auth_failed, no_callback, device_rejected with partition-table cause). It also discloses policy gating that can block invocation entirely — context an agent could not infer elsewhere.

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 core action and target, then defaults, then failure mapping — no filler sentences. It is dense to the point of being a single run-on block, which slightly hurts scanability but nothing is redundant.

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

Completeness4/5

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

For an 11-parameter, unannotated, device-mutating tool, the definition covers mechanism, defaults, pre-flight verification, failure diagnosis and policy blocking, and an output schema exists so return values need no explanation. What's missing is the semantics of env/project_dir/timeout_s and whether flashing reboots or erases the device.

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 coverage is only 18% across 11 params, so the description must compensate. It does add meaning for host, port defaults (3232/8266), auth (ArduinoOTA password), build, filesystem and verify_reachable, but leaves env, project_dir, timeout_s and the analytics params entirely to the schema, and gives no format hints (e.g. what env names look like).

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, resource, transport and target: "Flash firmware over Wi-Fi to an ESP32/ESP8266 running ArduinoOTA (espota)". The transport/protocol qualifier ('over Wi-Fi', 'espota') is exactly what separates it from a wired upload sibling, so an agent can route without opening either 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 context for the major mode switches: default behaviour (resolve+ping, then `pio run -t upload`), build=false (send existing firmware.bin via espota.py), and filesystem=true (SPIFFS/LittleFS image). It also notes the tool is blocked under build_only/read_only policy. It never explicitly contrasts with the wired `pio_upload` sibling, so it stops short of full when/when-not guidance.

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