watch_variables
Sample variables repeatedly without halting the CPU, returning a time-series table for live monitoring of RAM globals and statics.
Instructions
Live-watch one or more variables WITHOUT halting the CPU: sample them repeatedly while the target runs and return a time-series table.
names : comma- or space-separated variable names (requires load_elf). samples : number of snapshots, 1-200. interval_ms : delay between snapshots in milliseconds.
Works for RAM globals/statics (read live via background memory access). CPU registers need a halt and aren't supported here. Multi-word values are read non-atomically, so a >4-byte value may be momentarily inconsistent.
This tool is one-shot and returns a flat text table. For an open-ended,
auto-refreshing GUI window with expandable structs/arrays, there is a
separate standalone program called openocd-watch. It is NOT reachable
through this MCP server as a tool call — but it is an ordinary console
script, so an assistant with its own shell/process-launch capability
(e.g. a coding agent with a terminal tool) MAY run it directly as a
background process for the user, same as it would run any other CLI
program. An assistant limited to this server's MCP tools cannot reach it
and should tell the user to run it themselves instead. Invocation:
openocd-watch --elf <path/to/firmware.elf>
Add --autostart if OpenOCD isn't already running.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| names | Yes | ||
| samples | No | ||
| interval_ms | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |