Skip to main content
Glama

ESPTool Raw Pass-Through

esptool_raw
Destructive

Runs raw esptool commands against ESP devices for advanced firmware flashing, erasing, and chip operations; destructive subcommands require explicit confirmation.

Instructions

Pass-through to esptool.

Destructive subcommands (write_flash, erase_flash, erase_region, merge_bin) require confirm=True, or the user's answer when the client can ask; other subcommands run without asking. Prefer the high-level pio_flash / erase_and_flash / update_flash tools where possible; they know board-specific offsets and protocols.

Security: args is passed directly to the esptool binary. All arguments must come from a trusted source; do not allow untrusted content (e.g. mesh packet payloads) to flow into argument lists.

Returns {exit_code, stdout, stderr, stdout_tail, stderr_tail, duration_s}.

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": {
      "args": "<args>"
    },
    "name": "esptool_raw"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsYesThe esptool arguments, from a trusted source only.
portNoSerial port, passed as `--port`; omit to leave it to `args` or esptool.
confirmNo`True` once the user agreed; omitted, a client that can ask prompts the human. Only destructive subcommands ask.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true, openWorldHint=true and idempotentHint=false, but the description adds substantive behavior beyond them: the confirm gating rule for write_flash/erase_flash/erase_region/merge_bin, the fact that non-destructive subcommands run unprompted, the security constraint that args go straight to a binary, and the return shape. This is exactly the extra context a raw-execution tool needs.

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, front-loaded blocks — purpose, confirmation behavior, sibling preference, security, return shape — with no filler. The confirmation paragraph largely restates the `confirm` schema description, which is the only redundancy.

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 raw binary pass-through, the definition covers safety gating, the trusted-input requirement, alternative tools, and return keys; an output schema also exists, so return values need no elaboration. Nothing essential to invoking it safely is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns above that by explaining that `args` is passed verbatim to the esptool binary (and thus must be trusted) and that `port` maps to `--port` while being omittable in favor of `args`. It slightly duplicates the schema's confirm wording rather than adding new meaning there.

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 action (raw pass-through) against a specific resource (`esptool`), and immediately contrasts it with the high-level siblings `pio_flash` / `erase_and_flash` / `update_flash`. An agent can tell this is the escape hatch for arbitrary esptool subcommands rather than the guided flashing path.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says to prefer the high-level tools "where possible" and gives the reason (they know board-specific offsets and protocols), which defines when this tool is the correct fallback. It also names which subcommands trigger confirmation and that others run without asking, so the agent knows what interaction to expect.

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