Skip to main content
Glama

pio_partition_table

Validate the ESP32 flash partition layout before flashing: checks alignment, overlaps, size fit, OTA consistency, and optional live-device comparison to catch stale or corrupt tables.

Instructions

Validate the ESP32 flash layout before it bites. Reads the partition CSV the env uses (board_build.partitions, project partitions.csv, or the Arduino framework default), checks alignment, overlaps, fit against the chip's flash size, OTA slot/otadata consistency, nvs/coredump presence, whether the built firmware.bin fits the smallest app slot, and whether the build dir's partitions.bin is stale. With read_device=true it also reads the live table at 0x8000 over serial (esptool) and diffs it against the CSV, catching the silent-corruption case where an app-only flash left an old table on the chip. Returns partitions plus issues with fixes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
envNo
portNo
project_dirNo
read_deviceNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations provided, the description carries a heavy burden. It compensates by thoroughly disclosing the tool's behavior: what it reads (CSV sources), what checks it performs (alignment, overlaps, OTA, etc.), and side effects (when read_device=true it reads over serial via esptool). It also warns about the silent-corruption case, providing valuable context beyond mere function.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is lengthy and dense, packed with a long list of checks and details. While all information is useful, it could be front-loaded with the core purpose and streamlined to improve scannability. The key phrase 'Validate the ESP32 flash layout before it bites' is catchy but adds fluff. The structure is functional but not optimally concise.

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 complexity and the absence of annotations, the description covers all essential aspects: inputs, behavior, return value (partitions plus issues with fixes), and the optional live-device mode. The presence of an output schema likely covers return structure, and the description does not need to repeat that. It is complete for an agent to decide when and how to call it.

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?

The schema description coverage is 0%, so the description must compensate. It explains that 'env' selects the CSV based on board_build.partitions, 'read_device' triggers a live read and diff, and 'port' is used for serial communication. It does not explicitly detail 'project_dir', but the overall usage is understandable from the description, adding meaning beyond the schema.

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 uses a specific verb ('Validate') and clearly identifies the resource (ESP32 flash layout, partition table) and the context (PlatformIO env). It differentiates from siblings by its unique focus on partition validation, explicitly listing checks and the optional live device comparison. This makes it highly distinguishable from tools like pio_build or pio_flash_and_verify.

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?

The description implies when to use this tool: when you need to validate partition layouts, check for silent corruption, or ensure OTA consistency. However, it does not explicitly state when NOT to use it or mention alternatives among siblings (e.g., for general flash verification). The context is clear but lacks explicit routing guidance.

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