Skip to main content
Glama
bitpirate-mcp
by Indigaz

read_flash

Reads target flash memory over the Bit-Pirate UART bridge via esptool, optionally enters download mode, and saves the dump to a file for firmware analysis.

Instructions

Read flash memory from target via esptool through the Bit-Pirate UART bridge. Optionally enters download mode first. Requires esptool installed. [allowed-write] [Duration: very-slow (~3-5 min for 1-2 MiB at 460800 baud; larger images proportionally longer). Background-dispatch required. Bridge mode persists after dump -- press the Bit-Pirate button or USB-replug to exit.]

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": {
      "size": "<size>",
      "output_path": "<output_path>"
    },
    "name": "read_flash"
  }
}

Input Schema

NameRequiredDescriptionDefault
baudNoBaud rate for flash read (115200 or 460800 recommended)
sizeYesNumber of bytes to read (e.g., 0x400000 for 4MB)
offsetNoFlash offset to start reading from
boot_pinNoESP32 GPIO for boot select (-1 to skip download mode entry)
reset_pinNoESP32 GPIO for reset (-1 to skip download mode entry)
output_pathYesPath to save the flash dump

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations at all, the description carries the full disclosure burden and does it well: it names the esptool dependency, quantifies runtime (very-slow, ~3-5 min per 1-2 MiB at 460800 baud), mandates background dispatch, and warns that bridge mode persists after the dump and must be cleared by button press or USB replug. It stops short of failure modes, whether an existing output file is overwritten, or what a partial dump looks like.

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?

Purpose is front-loaded in the first sentence, with operational caveats after. The bracketed metadata block is dense and tag-like but each piece (write allowance, duration, dispatch requirement, exit procedure) earns its place; a short bulleted split would read slightly better.

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 a six-parameter, annotation-free, output-schema-free hardware tool, the definition covers the dependency, the time cost, the dispatch constraint, and the post-call state change. What is missing is return/error behavior — since no output schema exists, the description could say whether the dump is written only to output_path and what a failure leaves behind.

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 100%, so every parameter including baud, offset, boot_pin and reset_pin is already documented in structured data. The description's only semantic addition is that download mode entry is optional, which the boot_pin/reset_pin defaults already convey. Baseline 3 applies.

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 and resource (read flash memory from target) plus the exact mechanism (esptool over the Bit-Pirate UART bridge), which implicitly separates it from the spi_flash_* siblings that operate over the SPI interface. The follow-up sentence clarifies that download-mode entry is optional and internal.

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

Usage Guidelines3/5

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

'Requires esptool installed' and 'Background-dispatch required' give real operational prerequisites. However, no alternative is named: there is an enter_download_mode sibling and several spi_flash_* readers, and the description never says when to call this instead of those or when to enter download mode separately.

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