Skip to main content
Glama

stm32_flash

Flashes firmware files to an STM32 board over ST-Link/SWD using OpenOCD, with optional reset and verification after programming.

Instructions

Flash firmware to STM32 board via ST-Link.

Writes the specified .elf (or .bin/.hex) file to the connected STM32's flash memory using OpenOCD over SWD.

Args: elf_path: Absolute path to the firmware file (.elf, .bin, or .hex). reset: If true, hard-reset the board after flashing. verify: If true, verify flash contents match the file. probe: Board nickname, probe nickname, or ST-Link SN to target a specific board.

Returns: Flash result — ST-LINK info, download status, verify result.

Input Schema

NameRequiredDescriptionDefault
probeNo
resetNo
verifyNo
elf_pathYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description must carry the full burden, and it does disclose real behavior: it overwrites the board's flash, uses OpenOCD/SWD, and explains what reset and verify actually do. It does not state that flashing is destructive/irreversible, what happens on verification failure, or how a probe is chosen when multiple boards are attached.

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?

The purpose is front-loaded in one sentence, followed by an efficient Args block that documents exactly the four parameters. The Returns block is mildly redundant given an output schema exists, but costs little.

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 mutating hardware tool with no annotations, the definition covers purpose, mechanism, and every parameter, and an output schema covers return values. The missing piece is the absence of safety context (flash is overwritten) and sibling routing, which would matter for an irreversible hardware 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: it names all four parameters and adds meaning the schema lacks (accepted formats .elf/.bin/.hex for elf_path, hard-reset semantics for reset, content comparison for verify, and nickname-or-SN targeting for probe). Defaults and value types are left to the schema, which is appropriate.

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?

States a specific verb and resource ('Flash firmware to STM32 board via ST-Link') and adds mechanism detail (OpenOCD over SWD, writes to flash memory). It does not explicitly distinguish itself from the close sibling stm32_build_and_flash, which an agent might reasonably confuse it with.

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?

Usage is implied by the description (use when you already have a built firmware file and a connected board), but there is no explicit when-to-use or when-not-to-use guidance. The obvious alternative, stm32_build_and_flash, is never mentioned, so the agent must infer the routing itself.

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