Skip to main content
Glama

erase_flash

Erase STM32 flash memory via J-Link using an address range or full chip erase. Requires confirmation because erasing is irreversible.

Instructions

Erase Flash / 擦除 Flash.

Args: start_address: Start address (optional) / 起始地址(可选) end_address: End address (optional) / 结束地址(可选) chip_erase: Whether to perform chip erase (wipes the bootloader too) / 是否整片擦除(会连 Bootloader 一起抹掉) confirm: Required: erasing is irreversible / 必填:擦除不可逆

Returns: Erase result / 擦除结果

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "erase_flash"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmNo
chip_eraseNo
end_addressNo
start_addressNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose two important traits: erasing is irreversible and chip_erase destroys the bootloader. It omits other behavioral facts an agent needs, such as whether the device must be connected/halted, what happens when start/end addresses are omitted, and whether confirm must be true for the call to proceed.

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 docstring layout is front-loaded and scannable, but the bilingual duplication of every line roughly doubles the length without adding information. The 'Returns: Erase result' line is wasted since an output schema exists.

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

Completeness3/5

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

For a destructive 4-parameter tool with no annotations, the description covers the parameters and the irreversibility warning, and the output schema handles return values. It is still missing operational preconditions (connection/halt state) and the semantics of omitted address ranges, which matter for a destructive operation.

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 description coverage is 0%, so the description must compensate, and it does document all four parameters with meaning beyond their titles: chip_erase's bootloader consequence and confirm's irreversibility requirement are genuinely useful. It does not explain the default behavior when start_address/end_address are null, which is the main remaining gap.

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 names a specific verb and resource ('Erase Flash'), which is unambiguous and clearly distinct from siblings like program_flash or verify_flash. It does not explicitly state the relationship to those siblings, so it falls short of a 5.

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

Usage Guidelines2/5

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

There is no guidance on when to use this tool versus program_flash or verify_flash, and no stated prerequisites such as needing a connected or halted target. The only conditional information is parameter-level (chip_erase wipes the bootloader), not usage-level.

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