Skip to main content
Glama

debug_mem

Read or write RAM and registers through an active debug session, with symbol-based access for structs. Works while the core is running, so you can inspect or patch live target memory.

Instructions

Read or write RAM/registers through the debug session.

Works while the core is running (real-time) as well as halted — unlike stm32_read_memory this does not launch a second OpenOCD.

Args: session_id: Session ID from debug_session_start. action: "read" (default) or "write". address: Hex address like "0x20000304". Mutually exclusive with symbol. symbol: Variable name resolved from the session ELF. Structs (size > 4 bytes) are auto-expanded into per-field reads. value: Value to write (hex "0xFF" or decimal) — write only. width: Access width — 8, 16, or 32 bits (auto from symbol size). count: Number of units to read (read only).

Returns: Memory contents as hex values, or write confirmation.

Input Schema

NameRequiredDescriptionDefault
countNo
valueNo
widthNo
actionNoread
symbolNo
addressNo
session_idYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations present, the description does meaningful work: it discloses the real-time-vs-halted capability, that it avoids spawning a second OpenOCD, that struct symbols auto-expand into per-field reads, and that address/symbol are mutually exclusive. It does not cover write safety while the core is running, failure behavior for a stale session_id, or rate/latency traits.

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

Conciseness5/5

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

Front-loaded with the one-line purpose, followed by a scoping caveat, then structured Args/Returns. Every sentence conveys information an agent needs; no restatement of the tool name or filler.

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?

An output schema exists so return format needn't be explained, and the description still sketches it. All 7 params are addressed and the session dependency is traced back to debug_session_start. Missing failure/edge-case behavior (invalid session, address inaccessible, write while running) keeps it short of full completeness for a mutation-capable hardware tool.

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% for 7 params, so the description must carry the load — and it documents every parameter, including the read/write values for `action` (absent from the schema's string enum), hex formatting for `address`/`value`, and width auto-derivation from symbol size. Minor gaps remain: `count` units/default interaction and what happens when `width` is supplied alongside `symbol` (schema default 32 vs 'auto from symbol size') are not reconciled.

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 concrete verb pair (read/write) and resource (RAM/registers) scoped to the active debug session, and explicitly contrasts itself with stm32_read_memory. It does not distinguish itself from live_memory_read/live_memory_write or debug_registers, which read similar data, so an agent still has residual ambiguity among those siblings.

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 a clear positive condition (works both running and halted, no second OpenOCD) and names the alternative it replaces (stm32_read_memory). There is no explicit 'when not to use' guidance or routing toward live_memory_* / debug_registers alternatives that overlap functionally.

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