Skip to main content
Glama

stm32_write_memory

Writes values to STM32 memory over OpenOCD using a raw hex address or an ELF-resolved variable/symbol path, with configurable width and probe selection.

Instructions

Write memory by address or variable name.

Writes a value to memory on 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. value: Value to write — hex "0xFF" or decimal "255". 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: Confirmation of the write operation.

Input Schema

NameRequiredDescriptionDefault
probeNo
valueNo
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
Behavior3/5

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

With no annotations, the description carries the full disclosure burden. It discloses the transport (OpenOCD), the two addressing paths, and that the call returns a confirmation. It omits the traits an agent most needs for a memory mutation: whether the target must be halted, whether the write can corrupt a running program, and whether a bad address fails safely or faults the core.

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?

Front-loads the one-line summary, then a paragraph of context, then per-argument docs. Every argument entry adds real information. The 'Returns: Confirmation of the write operation' line is wasted, since an output schema already exists, and the docstring formatting is slightly over-long for a six-parameter tool.

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 thin return description is not a real gap. Parameter-level completeness is excellent. What is missing is the operational envelope for a mutation with no annotations behind it: required debugger/session state, halt requirements, and failure behavior.

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?

Schema description coverage is 0%, so the description must do all the work, and it does: concrete format examples for address ("0x20000304") and value ("0xFF" or "255"), width enumerated as 8/16/32 with auto-detection from symbol size, symbol examples in both plain and nested C-path form, and the elf_path dependency. This is meaningfully richer than the bare schema titles.

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: writing a value to target memory via OpenOCD, by raw address or ELF-resolved symbol. The two addressing modes and the C-path syntax make the operation unmistakable. It does not name siblings such as stm32_read_memory or live_memory_write, so an agent must infer the boundary between one-shot debugger writes and live session writes.

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

Usage Guidelines4/5

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

Gives practical selection rules: address and symbol are mutually exclusive, symbol requires elf_path, and an empty probe auto-selects the only connected board. That covers how to pick between the two addressing modes. It never says when to prefer this over live_memory_write or debug_mem, nor what prerequisites (halted core, session state) must hold.

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