Skip to main content
Glama

stm32_read_memory

Read STM32 memory by raw hex address or ELF-resolved variable name via OpenOCD to inspect variables and debug firmware.

Instructions

Read memory by address or variable name (from ELF symbols).

Reads memory from the connected STM32 via OpenOCD. Can specify a raw hex address or a symbol resolved from the ELF — a plain variable name or a C path like "g_app.dosing.cfg.pid_kp".

Args: address: Hex address like "0x20000304". Mutually exclusive with symbol. symbol: Variable name ("blink") or C path ("app.state.rate"). Requires elf_path. elf_path: Path to .elf file for symbol resolution. count: Number of units to read (default 1). width: Access width — 8, 16, or 32 bits. Auto-detected from symbol size. probe: Board nickname, probe nickname, or ST-Link SN. Empty auto-selects the only connected board.

Returns: Memory contents formatted as hex values.

Input Schema

NameRequiredDescriptionDefault
countNo
probeNo
widthNo
symbolNo
addressNo
elf_pathNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

No annotations are provided, so the description must carry the full burden of disclosure, and it does reasonably well: it names the OpenOCD backend, explains the elf_path dependency for symbol resolution, states that width is auto-detected from the resolved symbol, and describes the return format as hex values. It omits whether the core must be halted or resumed while reading, and what errors occur when no board is connected.

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 definition is front-loaded: a one-line summary states address-versus-symbol access, followed by a compact Args/Returns block, so it is easy to scan. There is minor redundancy between the summary and the Args block (both explain symbols), but no wasted padding.

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?

Because an output schema exists, the definition does not need to explain the return values, although it still gives a one-line description. All six otherwise undocumented parameters are covered, along with the OpenOCD and connected-board requirement; the only gap is the absence of guidance on when to use this tool instead of the overlapping memory-read siblings.

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

Parameters5/5

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

With 0% schema description coverage, the description must document the parameters itself, and the Args block defines all six: the address format ("0x20000304"), the symbol format (a plain name or a C path such as "g_app.dosing.cfg.pid_kp"), the purpose of elf_path, count as a number of units, width values 8/16/32 with auto-detection, and probe identity or auto-selection. The width default of 32 differs from the auto-detection behavior the description states, which is useful information.

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 definition names a specific verb and resource (read memory from the connected STM32 via OpenOCD) and states both access modes: a raw hex address or a symbol resolved from the ELF. This is clear, but the definition never names the siblings whose job overlaps, such as debug_mem or live_memory_read, so the agent must work out on its own which of these tools to use.

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?

It gives useful rules for choosing a mode: address and symbol are mutually exclusive, a symbol needs elf_path, and an empty probe auto-selects the only connected board. It says nothing, though, about when to prefer this tool over live_memory_read or debug_mem, and nothing about prerequisites such as whether the target must be halted.

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