{"at":"2026-11-23T06:02:39.352Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T06:02:40.276Z","dir":"received","era":"server_discover","message":{"error":{"code":-32602,"data":"","message":"Invalid request parameters"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T06:02:40.427Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T06:02:41.361Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"experimental":{},"tools":{"listChanged":false}},"instructions":"STM32 on-chip debugging over GDB + OpenOCD/ST-Link/J-Link. Drive it as a loop:\nobserve -> orient (symbolize) -> hypothesize -> act safely -> verify.\n\nTool not in your list? Some clients cap how many tools they expose, so a tool you need\n(e.g. start_debug_session) may be hidden. Reach ANY tool via call(tool=\"<name>\", args={...}),\nor run several with batch - these always work even when the tool isn't directly listed.\nFor a hidden tool that only READS state, prefer call_read(tool=..., args=...): it is\nannotated read-only, so it does not trigger the approval prompt that call can. It judges\nthe ACTION, not the family: call_read(tool=\"debug_profile\", args={\"action\":\"get\"}) and\nhub(action=describe|measure) go through; the writing actions do not, and a refusal names\nthe actions it accepts.\nIf a tool you EXPECT does not exist AT ALL, call mcp_info first - it reports the version,\ncommit, install path and compact_mode of the build actually serving you. Never read the\nclient's plugin manifest off disk to work that out, and never restart to find out.\n\nThe surface is lean: related ops are action-dispatched families - pass the discriminator.\nbreakpoint(action=set|delete|list|watch), logging(action=start|stop|get|clear, channel=...),\nexpressions(action=assert|capture|compare), debug_profile(action=get|set),\ndebug_config(action=load|save|validate), read_registers(what=core|fault|cycle),\ninspect_symbol(what=size|type|address|resolve|functions|variables), frame(action=select|source|\nvariables), write_guard(action=policy|audit), hub(action=describe|power|data), coredump,\ntimeouts, typed_memory, snapshot, session_diagnostics.\n(Old standalone names still work if you call them.)\n\nCore workflow:\n0. Need OpenOCD server_args? Call suggest_server_args(mcu, probe) - it returns the\n   right -f interface/target cfgs (validated against OpenOCD's bundled scripts).\n   NEVER search the disk for .cfg files; OpenOCD resolves them from its scripts dir.\n1. start_debug_session, then ALWAYS run self_check first - it validates byte order,\n   the Cortex-M core, and the device family, catching link/config faults early.\n2. Set debug_profile(action=set, mcu, elf_path, svd_path) - symbols then auto-load on every\n   connect/recover_session (symbols are per-session). To load symbols mid-session without\n   flashing, call load_symbols. Without symbols, breakpoints on function names won't resolve.\n3. Reproduce with the fewest calls: prefer the composites over manual sequences -\n   flash_and_run (ELF -> halted at entry), debug_until (conditional breakpoint + run +\n   decoded backtrace/locals in one call), capture_state (\"where am I\" in one call).\n4. Diagnose a crash with reconstruct_fault_context: it unwinds the stacked exception\n   frame and resolves the true faulting PC to source file:line.\n5. Verify a fix with expressions(action=compare) / expressions(action=assert).\n\nKey rules (the target must cooperate):\n- Reads (registers/memory/frames) require a HALTED core. If a read fails with\n  target_unresponsive, the core is running - call halt_execution first.\n- run_and_wait returns a structured stop event; on timeout it leaves the core RUNNING.\n- A breakpoint TIMEOUT means the code path was NOT reached - do NOT just retry run_and_wait.\n  The location is usually gated by a flag/state/stimulus. Instead: halt_execution, then\n  capture_state + breakpoint(action=list) (hit_count=0 confirms it was never reached); read the\n  gating flag; then either set a breakpoint EARLIER on the path (or where the flag is set),\n  drive the precondition (write the flag/variable, send the UART/input stimulus), or use a\n  conditional breakpoint. Forcing a flag via write_memory changes behavior - note it.\n- Memory writes are guarded: option bytes, IWDG, and WWDG are blocked by default;\n  use write_guard(action=policy) to allow, or dry_run to simulate. Every write is audited.\n- If halting causes mysterious resets, configure_debug_freeze (freeze IWDG/WWDG/timers).\n- On probe_unavailable / connection_lost, call recover_session; tune flaky probes with\n  timeouts(action=set).\n- A wedged ST-Link USB endpoint cannot be cleared in software. If a programmable USB hub\n  is configured (debug_profile hub.channel), hub(action=power, state=off/on) is the only\n  in-band way to force a re-enumeration - and hub(action=data) un-enumerates a probe\n  without rebooting its board. Called directly, both need confirm=true - always in the\n  default confirm guard mode, and in ANY mode while THIS session's own GDB server is live\n  on that port. With the shared hub daemon (the default when the [hub] extra is installed)\n  that check covers every registered session on every MCP server on the rack; in local mode\n  it sees only the calling session, so isolate first with hub(action=data, exclusive=true).\n  reset_target(strategy=\"cold\") and recover_session's hub ladder are the one deliberate\n  exception: they cut power with no confirm argument, because naming them is the\n  confirmation, and they stop the session before the cut. Every decision is audited\n  either way. Without a hub, that recovery is still a physical replug.\n- The ST-Link SWD/debug interface is EXCLUSIVE: while this MCP session is active, never\n  start a second OpenOCD/GDB on the same probe (e.g. a verify script's own --reset will\n  fail with \"ST-Link in use\"). Reset via reset_target instead. The ST-Link virtual COM\n  port (e.g. COM3) is a SEPARATE USB endpoint and DOES coexist with debugging - read it\n  with logging(action=start, channel=\"uart\"), or let an external serial script use it without resetting.\n\nObservability: to find where firmware spends time or what loop it is stuck in, use\nsample_pc - a non-intrusive statistical profiler that runs over SWD (no SWO pin / firmware\nchange) and returns a symbolized hot-spot histogram. For printf-over-SWO, call\nsetup_swo(hclk_hz, swo_hz) once (it configures TPIU+ITM from the debugger), then capture with\nlogging(action=start, channel=\"swo\", file=<output>) - no external decoder needed.\n\nEvery result is one compact JSON envelope: {ok, data?, error?, raw_response?,\nsuggested_next_actions?} - empty fields are omitted. Successful results omit the raw\nGDB/MI records unless the server runs with STM32_GDB_MCP_VERBOSE=1; failures always\ninclude them as evidence.\n\nDeterminism & sharing: every call is journaled - review it with get_session(view=journal|\ntimeline|metrics). Replay a repro with run_scenario; bundle a full, shareable report\nwith export_debug_report. Most results carry suggested_next_actions - follow them.\n\nSelf-reporting: if a tool behaves wrongly, gives a confusing result, or you get stuck on\nwhat looks like an MCP bug (not a target bug), call report_issue(title, description) - it\nfiles a structured GitHub issue auto-bundling this session's journal so the MCP can be fixed.\n\nMultiple boards: pass session=\"<name>\" to ANY tool to target an isolated debug session\n(its own connection, profile, breakpoints, logs). Omit it for the single 'default' session.\nlist_sessions / close_session manage them. For truly concurrent OpenOCD instances, give each\nsession distinct server_args (gdb_port and adapter serial).\n","protocolVersion":"2025-11-25","serverInfo":{"name":"stm32-gdb-mcp","version":"1.30.0"}}}}
{"at":"2026-11-23T06:02:41.361Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T06:02:41.361Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T06:02:41.366Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Starts the specified GDB Server (openocd, stlink, jlink) and connects the GDB Client to it. openocd REQUIRES server_args naming the probe and target, e.g. ['-f','interface/stlink.cfg','-f','target/stm32l4x.cfg'] — without them OpenOCD cannot find a config or adapter. Omitted values come from the active debug profile.","inputSchema":{"properties":{"hub_channel":{"description":"Take the probe on this hub channel, using the usb_location recorded for it in the profile's hub.map. Falls back to hub.channel, then to the map entry whose label matches this session's name.","type":"integer"},"probe":{"description":"Optional OpenOCD probe type: stlink, jlink, or cmsis-dap. Falls back to the profile, then a unique detected probe.","type":"string"},"serial":{"description":"Probe/ST-Link serial to select a specific board (for concurrent multi-target). Auto-added as 'adapter serial <serial>'.","type":"string"},"server_args":{"description":"Optional args for the server e.g. ['-f', 'interface/stlink.cfg', '-f', 'target/stm32f4x.cfg']","items":{"type":"string"},"type":"array"},"server_type":{"description":"Type of debug server backend.","enum":["openocd","stlink","jlink"],"type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"speed_khz":{"description":"OpenOCD adapter clock used when server_args are inferred (default 4000).","type":"integer"},"usb_location":{"description":"Select the probe by physical USB position, e.g. '1-1.4'. This is how to pick one of several probes that report NO serial number (most clone ST-Links), and unlike hub isolation it disconnects nobody -- two sessions can debug two boards at once. Added as 'adapter usb location <value>'. Usually you want hub_channel instead, which looks this up.","type":"string"}},"type":"object"},"name":"start_debug_session"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Stops the GDB client/server, variable tracking, and all active RTT/SWO/UART readers.","inputSchema":{"properties":{"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"stop_debug_session"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Validates the link right after connecting: reads CPUID and DBGMCU IDCODE and checks byte order, that a real Cortex-M is present, and that the device matches the expected family (from the profile MCU or the 'expected_family' arg). Run this first to catch endianness/config faults before debugging. Halts the core first (identity reads are unreliable while running); pass halt=false to skip.","inputSchema":{"properties":{"expected_family":{"description":"Expected MCU/family, e.g. 'STM32L431'. Defaults to the profile MCU.","type":"string"},"halt":{"description":"Halt the core before reading (default true).","type":"boolean"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"self_check"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Lists physical ST-Link, J-Link, and CMSIS-DAP probes currently connected over USB. Preserves serial numbers so multiple identical probes are never silently collapsed.","inputSchema":{"properties":{"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"detect_probe"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Returns the correct OpenOCD server_args for an MCU family + probe (e.g. STM32L431 + stlink -> ['-f','interface/stlink.cfg','-f','target/stm32l4x.cfg']) and validates the config files exist in OpenOCD's bundled scripts dir. Call this to get start_debug_session args — do NOT search the disk for .cfg files.","inputSchema":{"properties":{"mcu":{"description":"MCU or family, e.g. 'STM32L431' or 'STM32F4'.","type":"string"},"probe":{"description":"Optional. Debug probe: stlink, jlink, or cmsis-dap. If omitted, uses debug profile probe.","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"speed_khz":{"description":"Adapter clock in kHz (default 4000; 0 keeps the config default).","type":"integer"}},"required":["mcu"],"type":"object"},"name":"suggest_server_args"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Sets the SWD/JTAG adapter clock (kHz) at runtime. The default ST-Link speed is only ~480 kHz; raising it (e.g. 4000) speeds up flashing and memory reads ~8x. Lower it if reads/flash become unreliable.","inputSchema":{"properties":{"khz":{"description":"Adapter clock in kHz, e.g. 4000.","type":"integer"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"required":["khz"],"type":"object"},"name":"set_adapter_speed"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"description":"Runs several tool calls in ONE round trip and returns ALL their full results — the fastest way to do a sequence of operations (e.g. read registers + backtrace + several variables) without per-call latency. ok is false if ANY step failed; data.succeeded/data.failed count the outcomes (count/total only count steps run vs requested). Pass session to run every step against a named debug session.","inputSchema":{"properties":{"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"steps":{"description":"Ordered tool calls, each {tool, args}.","items":{"properties":{"args":{"type":"object"},"tool":{"type":"string"}},"required":["tool"],"type":"object"},"type":"array"},"stop_on_error":{"description":"Stop at the first failing step (default false).","type":"boolean"}},"required":["steps"],"type":"object"},"name":"batch"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"description":"Invoke ANY stm32-gdb-mcp tool by name — including one that is NOT in your current tool list (clients with tool-count limits may hide some). Use this to reach e.g. start_debug_session when it isn't directly listed: call(tool='start_debug_session', args={...}). Returns that tool's result.","inputSchema":{"properties":{"args":{"description":"Arguments for that tool.","type":"object"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"tool":{"description":"Name of the tool to invoke.","type":"string"}},"required":["tool"],"type":"object"},"name":"call"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Like call, but restricted to tools that only READ state — so it needs no approval prompt where call, which can reach anything, does. Prefer it for hidden read-only tools: call_read(tool='read_core_registers', args={}). The gate is per-ACTION, not per-tool: a family's reading action goes through even though the family also writes, so call_read(tool='debug_profile', args={'action':'get'}) works while action='set' does not. A refusal names the actions it would accept. Refuses anything that writes; use call for those.","inputSchema":{"properties":{"args":{"description":"Arguments for that tool.","type":"object"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"tool":{"description":"Name of the read-only tool to invoke.","type":"string"}},"required":["tool"],"type":"object"},"name":"call_read"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Returns descriptions and complete schemas for full-surface tools, including tools hidden in compact mode.","inputSchema":{"properties":{"name":{"description":"Exact tool name.","type":"string"},"query":{"description":"Case-insensitive name/description search.","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"tool_help"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Identifies THIS running stm32-gdb-mcp server: release version, git commit, the package directory the code was imported from (plus the install root the git probe used), whether compact mode is hiding tools, and how many tools this build advertises versus how many exist. Needs NO debug session, NO probe and NO target — call it the moment a tool you expect is missing or behaves like an older build, instead of guessing which checkout the client actually launched.","inputSchema":{"properties":{"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"mcp_info"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Recovers a dropped or wedged session: cleanly tears down the GDB client and server, then restarts the server (with retry/backoff for a busy probe) using the last start_debug_session arguments and reconnects. Use after a probe_unavailable or connection_lost error. When a programmable USB hub is configured (debug_profile hub.channel), a retry that cannot fix the probe escalates to toggling its USB data lines and then power-cycling the port -- the only in-band cure for a wedged endpoint. Any hub action taken is reported in recovery_steps.","inputSchema":{"properties":{"deep":{"description":"Add a long (2 s) power-off rung to drain bulk capacitance.","type":"boolean"},"escalate":{"description":"Allow hub data-line/power escalation when a plain retry fails (default true).","type":"boolean"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"recover_session"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"description":"Builds firmware with Keil uVision (UV4), CMake, make, or a custom command, so the AI can rebuild after a fix. Keil emits a .axf (ELF/DWARF) that the debug tools load like any .elf. Returns the exit code, success flag, and build log tail.","inputSchema":{"properties":{"build_dir":{"description":"cmake: the configured build directory.","type":"string"},"command":{"description":"custom: full argv to run.","items":{"type":"string"},"type":"array"},"config":{"description":"cmake: build config, e.g. Debug/Release.","type":"string"},"cwd":{"description":"Working directory for the build.","type":"string"},"directory":{"description":"make: directory containing the Makefile.","type":"string"},"kind":{"description":"Toolchain to build with.","enum":["keil","cmake","make","custom"],"type":"string"},"project":{"description":"keil: path to the .uvprojx/.uvproj project.","type":"string"},"rebuild":{"description":"keil: rebuild all (-r) instead of incremental (-b).","type":"boolean"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"target":{"description":"Keil/CMake/make build target.","type":"string"},"timeout_sec":{"description":"Max build seconds (default 600).","type":"number"},"uv4_path":{"description":"keil: path to UV4.exe (auto-detected if omitted).","type":"string"}},"required":["kind"],"type":"object"},"name":"build_firmware"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Loads symbols from an ELF/AXF into the current GDB session WITHOUT flashing. Symbols are per-session, so after a fresh connect or recover_session you need this (or flash_firmware) before symbol breakpoints resolve. Falls back to the debug profile's elf_path if elf_path is omitted.","inputSchema":{"properties":{"elf_path":{"description":"Path to the ELF/AXF. Defaults to the profile elf_path.","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"load_symbols"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Flashes a compiled firmware binary to the target. Accepts GCC .elf or Keil .axf. By default it then resets and RUNS the firmware (Keil-style 'Load + Run'). Pass reset_run=false to flash only (e.g. to set breakpoints before the firmware starts). Refuses (elf_layout_unsupported) an image GDB would flash incompletely, such as a Keil ARMCC5 AXF whose RW initializer lies outside its segment; flash its fromelf BIN instead.","inputSchema":{"properties":{"file_path":{"description":"Absolute path to the compiled firmware file (e.g. .elf/.axf).","type":"string"},"reset_run":{"description":"Reset and run after flashing (default true). False = flash only, leave halted.","type":"boolean"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"required":["file_path"],"type":"object"},"name":"flash_firmware"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Resets the target device. Can optionally halt immediately after reset. strategy=\"cold\" removes target power through a configured programmable USB hub before resetting, which is the only strategy that produces a true power-on reset (RCC_CSR POR flag, cleared .noinit, drained RAM); it fails rather than silently doing a warm reset when no hub channel is mapped. It needs no confirm argument -- asking for a cold reset by name IS the confirmation the hub guard wants -- and it stops the GDB session before the cut, then re-establishes it.","inputSchema":{"properties":{"command":{"description":"Optional custom GDB monitor reset command.","type":"string"},"halt":{"description":"If true, halts the CPU immediately after reset.","type":"boolean"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"strategy":{"description":"Optional reset strategy: default, under_reset, software, or cold (hub power cycle). \"software\" issues soft_reset_halt, which resets through the debug unit WITHOUT asserting SYSRESETREQ -- so RCC_CSR does not record it and its sticky reset flags do not move; use \"default\" when the reset must be visible there, e.g. when proving a cold boot by watching a sticky flag disappear. \"under_reset\" is currently an alias of \"default\". The result's `note` says which of these applied to the call you actually made.","type":"string"}},"required":["halt"],"type":"object"},"name":"reset_target"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Resumes execution of the target device until the next breakpoint. Safe to call when the target is already running (reports already_running instead of erroring), so 'make sure it is running' is expressible.","inputSchema":{"properties":{"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"continue_execution"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Interrupts/halts the target device execution.","inputSchema":{"properties":{"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"halt_execution"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Resumes the target and waits, returning a structured stop event (reason, symbolized frame, breakpoint id, signal) or a timeout. Use this instead of continue_execution + polling to close the debug loop.","inputSchema":{"properties":{"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"timeout_sec":{"description":"Max seconds to wait for a stop (default 10).","type":"number"}},"type":"object"},"name":"run_and_wait"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"One-call repro step: set an optional conditional/temporary breakpoint at a location, run, and return the stop event PLUS the decoded backtrace and innermost-frame locals. Collapses set_breakpoint + run + read frame/vars into a single round-trip.","inputSchema":{"properties":{"condition":{"description":"Optional C condition, e.g. 'g_divisor == 0'.","type":"string"},"ignore_count":{"description":"Hits to ignore before stopping.","type":"integer"},"location":{"description":"Where to break, e.g. 'trigger_divzero' or 'main.c:21'.","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"temporary":{"description":"Auto-delete the breakpoint after the first hit (default true).","type":"boolean"},"timeout_sec":{"description":"Max seconds to wait (default 10).","type":"number"}},"required":["location"],"type":"object"},"name":"debug_until"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"One-call 'where am I': decoded core registers + a PC/LR/SP summary, the decoded backtrace, and the innermost-frame locals. The fastest way to get full halted context.","inputSchema":{"properties":{"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"capture_state"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"One-call bring-up: flash an ELF (loads symbols), reset-halt, set a temporary breakpoint at an entry point (default 'main'), run to it, and return the decoded stop context. With hub_channel (or usb_location) and no session running, it starts one pinned to that probe first -- so 'flash the firmware on channel 4' is this single call, on a bench with several probes, without disconnecting any of the others.","inputSchema":{"properties":{"file_path":{"description":"Path to the ELF to flash.","type":"string"},"hub_channel":{"description":"Start a session on the probe at this hub channel first, if none is running. Uses the usb_location recorded for it in the profile's hub.map. Ignored when a session is already live -- it flashes through that one.","type":"integer"},"mcu":{"description":"Passed through when this call starts the session; falls back to the profile.","type":"string"},"run_to":{"description":"Entry point to stop at (default 'main').","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"timeout_sec":{"description":"Max seconds to wait (default 10).","type":"number"},"usb_location":{"description":"Same, but naming the USB position directly, e.g. '1-1.4'.","type":"string"}},"required":["file_path"],"type":"object"},"name":"flash_and_run"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Runs the target freely for a wall-clock duration, halts it, and returns one structured report with final frame/context and optional expression captures. Useful for counters, telemetry buffers, polling loops, and timing-sensitive bus diagnostics without breakpoint perturbation.","inputSchema":{"properties":{"capture":{"properties":{"expressions":{"description":"Optional GDB/C expressions to capture after halting.","items":{"type":"string"},"type":"array"},"table":{"description":"Optional indexed table capture after halting: {index_range:[start,end], columns:[prefix,...]}.","type":"object"}},"type":"object"},"duration_sec":{"description":"Seconds to let the target run freely.","type":"number"},"resume_after":{"description":"Resume execution after capture (default false).","type":"boolean"},"sample":{"description":"Best-effort low-rate debugger polling while running; does not halt the target.","properties":{"expressions":{"description":"GDB/C expressions to poll while the target runs.","items":{"type":"string"},"type":"array"},"interval_ms":{"description":"Low-rate polling interval in milliseconds.","type":"number"},"interval_sec":{"description":"Low-rate polling interval in seconds.","type":"number"},"max_samples":{"description":"Safety cap on generated samples (default 10000).","type":"integer"},"table":{"description":"Optional indexed table to poll: {index_range:[start,end], columns:[prefix,...]}.","type":"object"}},"type":"object"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"then":{"description":"Action after duration (default halt).","enum":["halt"],"type":"string"}},"required":["duration_sec"],"type":"object"},"name":"run_for_duration"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Waits for the next stop event WITHOUT resuming the target, returning a structured stop event or a timeout.","inputSchema":{"properties":{"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"timeout_sec":{"description":"Max seconds to wait for a stop (default 10).","type":"number"}},"type":"object"},"name":"wait_for_stop"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Single-steps the target: kind='over' (over the line), 'into' (into calls), 'out' (run until the function returns), or 'instruction' (one machine instruction; set over=true to step over a call).","inputSchema":{"properties":{"kind":{"description":"Step kind (default 'over').","enum":["over","into","out","instruction"],"type":"string"},"over":{"description":"For kind='instruction', step over a called function.","type":"boolean"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"step"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Reads the value of a C variable currently in scope.","inputSchema":{"properties":{"name":{"description":"Name of the variable to read.","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"required":["name"],"type":"object"},"name":"read_variable"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Reads a block of memory from the target. Returns the raw bytes in memory order, plus value_le -- the same bytes as one little-endian value -- for a 1/2/4/8-byte read. Use value_le for a peripheral register: the raw string arrives least-significant-byte first, so reversing it by hand is where bit positions get misread.","inputSchema":{"properties":{"address":{"description":"Hex address to read from, e.g., '0x20000000'.","type":"string"},"length":{"description":"Number of bytes to read.","type":"integer"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"required":["address","length"],"type":"object"},"name":"read_memory"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Writes a value to a specific memory address.","inputSchema":{"properties":{"address":{"description":"Hex address to write to, e.g., '0x20000000'.","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"value":{"description":"Value to write, e.g., '0xFF' or '1234'.","type":"string"}},"required":["address","value"],"type":"object"},"name":"write_memory"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Reads the call stack as a decoded list of frames {level, func, file, line, addr} plus a one-line summary. Set include_raw=true to also get the raw GDB output.","inputSchema":{"properties":{"include_raw":{"description":"Include the raw GDB transcript (default false).","type":"boolean"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"read_call_stack"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Reads and decodes Cortex-M fault registers into likely fault causes.","inputSchema":{"properties":{"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"diagnose_fault"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Freezes peripherals (IWDG, WWDG, RTC, timers) while the core is halted via the DBGMCU freeze registers, so the watchdog cannot reset the target out from under the debugger. Family is taken from the debug profile MCU if omitted.","inputSchema":{"properties":{"apply":{"description":"If false, only return the planned register writes (default true).","type":"boolean"},"family":{"description":"STM32 family or part number. Known: ['stm32f4', 'stm32l4'].","type":"string"},"peripherals":{"description":"Peripherals to freeze, e.g. ['iwdg', 'wwdg', 'rtc', 'tim2'].","items":{"type":"string"},"type":"array"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"required":["peripherals"],"type":"object"},"name":"configure_debug_freeze"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Reports stack used/free bytes and a clear overflow verdict for the halted core. stack_top defaults to the initial MSP (first word of the vector table at vector_table_addr). Give stack_size or stack_limit for the overflow check (else only usage is reported). The key tool for diagnosing stack overflows.","inputSchema":{"properties":{"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"stack_limit":{"description":"Lowest valid stack address (hex).","type":"string"},"stack_size":{"description":"Stack size in bytes (used as stack_top - stack_size if stack_limit omitted).","type":"string"},"stack_top":{"description":"Top-of-stack address (hex). Default: initial MSP from the vector table.","type":"string"},"vector_table_addr":{"description":"Vector table base for the initial MSP (default '0x08000000').","type":"string"}},"type":"object"},"name":"analyze_stack"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Reconstructs the full crash site after a HardFault: decodes fault registers, unwinds the auto-stacked exception frame from MSP/PSP via EXC_RETURN to recover the true faulting PC, and resolves it to source file:line. Run this when halted in a fault handler.","inputSchema":{"properties":{"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"reconstruct_fault_context"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Discovers firmware project artifacts such as ELF, map, linker script, SVD, and STM32CubeMX .ioc metadata.","inputSchema":{"properties":{"project_root":{"description":"Project directory to scan. Uses debug profile project_root if omitted.","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"inspect_project"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Detects whether FreeRTOS symbols are available in the current GDB session.","inputSchema":{"properties":{"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"detect_rtos"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Reads FreeRTOS state by 'what': 'current_task' (pxCurrentTCB), 'tasks' (ready list: names/priorities/TCB/stack), 'task_lists' (ready/delayed/suspended/deleted), 'queue' or 'mutex' (needs handle = a Queue_t expression), or 'heap' (heap_4/5 usage).","inputSchema":{"properties":{"handle":{"description":"For 'queue'/'mutex': GDB expression for the Queue_t pointer/handle.","type":"string"},"max_priorities":{"description":"tasks/task_lists: priority count override.","type":"integer"},"max_tasks":{"description":"tasks/task_lists: max tasks to return.","type":"integer"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"what":{"enum":["current_task","tasks","task_lists","queue","mutex","heap"],"type":"string"}},"required":["what"],"type":"object"},"name":"read_freertos"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Loads an SVD file for peripheral parsing.","inputSchema":{"properties":{"filepath":{"description":"Path to the .svd file.","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"required":["filepath"],"type":"object"},"name":"load_svd"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Reads a peripheral register using its name from the loaded SVD.","inputSchema":{"properties":{"peripheral":{"description":"Peripheral name (e.g., 'GPIOA').","type":"string"},"register":{"description":"Register name (e.g., 'ODR').","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"required":["peripheral","register"],"type":"object"},"name":"read_peripheral_register"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Reads and decodes a peripheral register with SVD bitfield names and enumerated values.","inputSchema":{"properties":{"peripheral":{"description":"Peripheral name (e.g., 'GPIOA').","type":"string"},"register":{"description":"Register name (e.g., 'MODER').","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"required":["peripheral","register"],"type":"object"},"name":"decode_peripheral_register"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Background variable tracking: action='start' (needs variable + interval_ms), 'stop', or 'get' (returns the sampled data for trend/leak analysis).","inputSchema":{"properties":{"action":{"description":"What to do.","enum":["start","stop","get"],"type":"string"},"interval_ms":{"description":"For 'start': polling interval in ms.","type":"integer"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"variable":{"description":"For 'start': the variable/expression to sample.","type":"string"}},"required":["action"],"type":"object"},"name":"track_variable"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Returns this session's record by view: 'journal' (every tool call with args/ok/summary/duration; supports limit), 'timeline' (compact human-readable replay), or 'metrics' (per-tool call counts, success/failure, durations).","inputSchema":{"properties":{"limit":{"description":"journal: return only the most recent N entries.","type":"integer"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"view":{"description":"Which view (default journal).","enum":["journal","timeline","metrics"],"type":"string"}},"type":"object"},"name":"get_session"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Clears the session journal (keeps the run-id).","inputSchema":{"properties":{"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"clear_session_journal"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Lists all debug target sessions (the 'default' one plus any named) with their liveness and port. To debug MULTIPLE boards at once, pass a 'session' argument (any string) to any tool — e.g. start_debug_session(session='rackA', ...) — and each gets fully isolated state.","inputSchema":{"properties":{"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"list_sessions"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Closes a named debug session, tearing down its GDB client and server.","inputSchema":{"properties":{"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"session_id":{"description":"Name of the session to close, e.g. 'rackA'.","type":"string"}},"required":["session_id"],"type":"object"},"name":"close_session"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"description":"Files a GitHub issue about an MCP problem from THIS session — auto-bundling the session journal, metrics, and MCP version into a structured report (via the gh CLI). Call this when a tool misbehaves or confuses you. Deduplicated per session so retries don't spam. Defaults to the stm32-gdb-mcp repo.","inputSchema":{"properties":{"description":{"description":"What you were doing and what went wrong.","type":"string"},"env":{"description":"Agent/IDE + model, e.g. 'Cursor / deepseek-v4-pro'.","type":"string"},"repo":{"description":"owner/repo to file under (default the MCP repo).","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"title":{"description":"Short issue title, e.g. '[agent] start_debug_session ignores server_args'.","type":"string"}},"required":["title","description"],"type":"object"},"name":"report_issue"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Writes a single self-contained JSON report (journal + metrics + profile, optionally a state snapshot and a coredump) tied to the run-id, so a bug session is fully reproducible and shareable from one artifact.","inputSchema":{"properties":{"coredump_path":{"description":"If set, capture a coredump there and reference it in the report.","type":"string"},"include_snapshot":{"description":"Capture and embed a debug snapshot (requires a halted target).","type":"boolean"},"path":{"description":"Output path for the report JSON.","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"required":["path"],"type":"object"},"name":"export_debug_report"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"description":"Replays a declarative scenario — a list of {tool, args} steps — deterministically and returns a per-step pass/fail report. Provide inline 'steps' or a 'path' to a JSON scenario file. The minimal-step way to re-run a complex bug repro.","inputSchema":{"properties":{"path":{"description":"Path to a JSON scenario file (alternative to inline steps).","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"steps":{"description":"Ordered steps, each {tool, args}.","items":{"properties":{"args":{"type":"object"},"tool":{"type":"string"}},"required":["tool"],"type":"object"},"type":"array"},"stop_on_failure":{"description":"Stop at the first failing step (default true).","type":"boolean"}},"type":"object"},"name":"run_scenario"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Runs until a given location is reached (function, 'file.c:42', or '*0xADDR').","inputSchema":{"properties":{"location":{"description":"Where to run to.","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"required":["location"],"type":"object"},"name":"run_to_line"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Disassembles N instructions at a location (default $pc).","inputSchema":{"properties":{"instructions":{"description":"Number of instructions (default 8).","type":"integer"},"location":{"description":"Where to disassemble from (default '$pc').","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"disassemble"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Verifies that target flash matches an ELF (GDB compare-sections). Compares read-only sections, which is what lives in flash; writable sections hold the ELF's initial RAM values and always differ once the firmware has run, so including them would fail every healthy target. Pass include_writable=true only right after a load, before the target has executed.","inputSchema":{"properties":{"file_path":{"description":"Path to the ELF to verify against.","type":"string"},"include_writable":{"description":"Also compare writable (RAM) sections. Only meaningful immediately after a load.","type":"boolean"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"required":["file_path"],"type":"object"},"name":"verify_flash"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Erases a flash range on the target (OpenOCD 'flash erase_address pad'), rounding out to the driver's erase-sector boundaries. The recovery tool for a board that will not boot: clearing a corrupt OTA journal, a stale boot descriptor, or a half-written image. Requires an explicit address AND length — there is deliberately no mass-erase default.","inputSchema":{"properties":{"address":{"description":"Start address, e.g. '0x08016000'. Rounded DOWN to the erase-sector boundary.","type":"string"},"length":{"description":"Bytes to erase. Rounded UP to the erase-sector boundary.","type":"integer"},"sector_size_bytes":{"description":"Erase-sector size of this part (e.g. 4096 on STM32L1, up to 131072 on F4). Give it and the write guard checks the padded range that is really erased; omit it and the guard can only check the range you asked for.","type":"integer"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"verify":{"description":"Read back the first 64 bytes and confirm they hold this part's erased value — 0x00 on STM32L0/L1, 0xFF elsewhere, taken from the profile MCU (default true).","type":"boolean"}},"required":["address","length"],"type":"object"},"name":"flash_erase"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"One-call SWO/ITM printf setup. Configures the target's TPIU+ITM from the debugger (no firmware ITM-init needed) for the given core clock (hclk_hz) and SWO baud, and returns the OpenOCD capture commands + the firmware printf retarget snippet. Then capture with logging(action=start, channel='swo', file=<output>). Requires the SWO pin (e.g. PB3) wired to the probe.","inputSchema":{"properties":{"apply_openocd":{"description":"Also run the OpenOCD capture commands via monitor now (default false).","type":"boolean"},"hclk_hz":{"description":"Core clock (HCLK) in Hz, e.g. 80000000 for an L4 at 80 MHz.","type":"integer"},"output":{"description":"OpenOCD ITM decode output file to tail (default 'swo_itm.log').","type":"string"},"port":{"description":"ITM stimulus port for printf (default 0).","type":"integer"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"swo_hz":{"description":"Desired SWO baud (default 2000000; ST-Link V2 max ~2 MHz).","type":"integer"},"tpiu_name":{"description":"OpenOCD tpiu object name if not the default '$_CHIPNAME.tpiu'.","type":"string"}},"required":["hclk_hz"],"type":"object"},"name":"setup_swo"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Statistical PC profiler: enables DWT and samples the program counter while the core RUNS (non-intrusive, over SWD — no SWO pin or firmware change). Returns a symbolized hot-spot histogram (top functions by %), not raw hex — the fast way to find where firmware spends time or what loop it is stuck in. A high 'unsampleable' count means the core is halted/asleep; a high 'zero_samples' count means nothing was profiled at all. Leave enable=true: GDB cannot write the enable bit while the core runs, so this halts briefly to set it and resumes, and only when it is not already set. Note some links cannot serve memory reads while the core runs at all (measured: OpenOCD + ST-Link + STM32L1) — there PC sampling is unavailable and the result says so rather than inventing a hot spot.","inputSchema":{"properties":{"count":{"description":"Number of samples (default 128; more = better statistics, slower).","type":"integer"},"enable":{"description":"Enable DWT trace before sampling (default true). With false, a target whose trace unit is off yields nothing.","type":"boolean"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"sample_pc"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Parse a schematic netlist (KiCad .net today) into a machine-readable BoardDescription: the MCU part/family/line, a per-pin map (package pin -> port pin -> net -> inferred peripheral function), and the power/ground nets. This is the input contract for automated framework design. Pass 'path' or 'text'. The result is stored on the session; read views with describe_board.","inputSchema":{"properties":{"db_path":{"description":"Optional JSON pin-capability DB; when given (or STM32_GDB_MCP_PIN_DB is set), pins are resolved physically (package position -> port pin, AF corroboration).","type":"string"},"format":{"description":"Netlist format: auto (default), kicad, altium (Protel .NET), orcad (pstxnet.dat) or csv (generic pin-map).","type":"string"},"path":{"description":"Path to a netlist file (e.g. board.net).","type":"string"},"session":{"description":"Target session id (default 'default').","type":"string"},"text":{"description":"Netlist contents inline (alternative to path).","type":"string"}},"type":"object"},"name":"import_netlist"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Read the BoardDescription imported by import_netlist. what=summary (MCU + peripherals + counts), pins (full MCU pin map), nets, power (power/ground nets), or peripherals (distinct peripherals in use).","inputSchema":{"properties":{"session":{"description":"Target session id (default 'default').","type":"string"},"what":{"description":"summary|pins|nets|power|peripherals (default summary).","type":"string"}},"type":"object"},"name":"describe_board"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Validate the imported BoardDescription: detect a package pin wired to multiple nets (short), a peripheral signal routed to multiple pins, a port pin driven by multiple nets, and missing power/ground/debug/reset nets. With a pin-capability DB (db_path or the STM32_GDB_MCP_PIN_DB env) it also checks alternate-function legality; unknown pins degrade to 'unverified', never a false conflict. Run import_netlist first.","inputSchema":{"properties":{"db_path":{"description":"Optional JSON pin-capability DB (CubeMX-derived) for AF-legality checks.","type":"string"},"session":{"description":"Target session id (default 'default').","type":"string"}},"type":"object"},"name":"validate_board"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Load a machine-checked AcceptanceSpec (product-spec → deterministic checks) from an inline 'spec' object or a JSON 'path'. Checks: memory_u32 (any memory-mapped register), variable (C global), core_register, no_fault, stopped_at (PC in a symbol). Stored on the session; evaluate with run_acceptance.","inputSchema":{"properties":{"path":{"description":"Path to a JSON AcceptanceSpec (alternative to 'spec').","type":"string"},"session":{"description":"Target session id (default 'default').","type":"string"},"spec":{"description":"Inline AcceptanceSpec {name, description, checks:[...]}.","type":"object"}},"type":"object"},"name":"load_acceptance"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Evaluate the loaded AcceptanceSpec against live silicon state and return a deterministic pass/fail/error verdict per check (the closed-loop judge). An unreadable target is reported as 'error', never a silent pass. A failing/errored check derived by synthesize_acceptance carries provenance.source — the init function + line that should satisfy it — so fixes are precision-guided. Run load_acceptance first; halt the target at the state you want to assert.","inputSchema":{"properties":{"session":{"description":"Target session id (default 'default').","type":"string"}},"type":"object"},"name":"run_acceptance"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Read the loaded AcceptanceSpec or the last verdict. what=summary (name + check counts), checks (full check list), or last_result (the most recent run_acceptance report).","inputSchema":{"properties":{"session":{"description":"Target session id (default 'default').","type":"string"},"what":{"description":"summary|checks|last_result (default summary).","type":"string"}},"type":"object"},"name":"describe_acceptance"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Start a bounded spec-to-silicon acceptance loop (Pillar C) for the loaded AcceptanceSpec. Each run_acceptance_iteration does one build → flash → run-to-state → run_acceptance pass; the loop stops on convergence, on max_iterations, or on a stall (same checks failing repeatedly). Omit build/flash to run evaluate-only iterations (you flash manually). Load a spec first.","inputSchema":{"properties":{"build":{"description":"Optional build_firmware config {kind, project|build_dir|directory, target, config, rebuild, command, cwd}.","type":"object"},"flash":{"description":"Optional flash+run config {file_path, run_to (default 'main'), timeout_sec}.","type":"object"},"max_iterations":{"description":"Hard bound on iterations (default 10).","type":"integer"},"session":{"description":"Target session id (default 'default').","type":"string"},"stall_patience":{"description":"Stop if the same checks fail this many times in a row (default 3).","type":"integer"}},"type":"object"},"name":"start_acceptance_loop"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Run one bounded loop iteration: (optional build) → (optional flash+run-to) → evaluate the AcceptanceSpec against live silicon, then record the verdict and return a decision (converged / should_continue / exhausted / stalled) plus the checks to fix. A build or run-to failure is recorded as a phase_error, not a crash. Refuses to run a terminal loop unless force=true. start_acceptance_loop first.","inputSchema":{"properties":{"force":{"description":"Run even if the loop already converged/exhausted/stalled.","type":"boolean"},"session":{"description":"Target session id (default 'default').","type":"string"}},"type":"object"},"name":"run_acceptance_iteration"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Read the acceptance loop's trajectory (per-iteration pass/fail counts, status) and the current decision without running an iteration.","inputSchema":{"properties":{"session":{"description":"Target session id (default 'default').","type":"string"}},"type":"object"},"name":"acceptance_loop_status"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Translate a controlled-vocabulary product spec (human/product terms) into the per-peripheral design params design_framework consumes, and cross-check it against the imported netlist. This is the upstream guard the pipeline lacked: instead of hand-writing HAL macros, supply intent -- UART framing '8N1', direction 'txrx', flow_control 'rtscts'; SPI role 'master', spi_mode 0..3, data_size, bit_order; I2C speed 'fast', addressing '7bit'; ADC resolution 12, conversion 'continuous'; a timer update_hz; plus dma / interrupt / priority opt-ins -- and the machine expands it deterministically (8E1 -> UART_WORDLENGTH_9B + UART_PARITY_EVEN, honoring HAL's parity-bit-in-word-length rule). A peripheral named in the spec but absent from the netlist is a conflict; an intent key or value the machine does not model is surfaced as unresolved -- never guessed. Then design_framework(from_spec=true) builds the plan from the translated params. Import a netlist first so the spec is cross-checked.","inputSchema":{"properties":{"session":{"description":"Target session id (default 'default').","type":"string"},"spec":{"description":"Per-peripheral intent, e.g. {'USART1': {'baud': 115200, 'framing': '8N1', 'direction': 'txrx'}, 'ADC1': {'resolution': 12, 'conversion': 'continuous', 'dma': true}}.","type":"object"}},"type":"object"},"name":"import_spec"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Synthesize a deterministic FrameworkPlan (Pillar D) from the session's imported board: which clocks to enable, how each pin must be muxed, and which peripheral init blocks to emit, in dependency order. Supply per-peripheral HAL .Init parameters via design={'USART1': {'baud': 115200, ...}} and optional AF numbers via af_map. Mandatory .Init members are auto-filled with HAL-standard defaults (a complete, valid init struct, not a half-initialized one) and a few are derived from the netlist (UART flow control from RTS/CTS pins, SPI NSS from an NSS pin); each field is tagged explicit/derived/default. Alternate-function numbers are also auto-derived from a pin-capability DB (db_path or the STM32_GDB_MCP_PIN_DB env) when its entries carry an 'af' field; an explicit af_map overrides the DB per pin. Anything that needs a human decision (baud, timer period, I2C timing) is surfaced as unresolved, never guessed. Import a netlist first (import_netlist).","inputSchema":{"properties":{"af_map":{"description":"Optional alternate-function numbers: {line_or_family: {port_pin: {'USART1_TX': 7}}}. Overrides db_path per pin.","type":"object"},"db_path":{"description":"Optional JSON pin-capability DB (CubeMX-derived); entries with an 'af' field auto-fill alternate-function numbers.","type":"string"},"design":{"description":"Per-peripheral config, e.g. {'USART1': {'baud': 115200, 'word_length': 'UART_WORDLENGTH_8B'}}.","type":"object"},"from_spec":{"description":"Build from the session's imported product spec (import_spec) instead of, or merged under, an explicit design (explicit keys win).","type":"boolean"},"session":{"description":"Target session id (default 'default').","type":"string"}},"type":"object"},"name":"design_framework"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Read the synthesized FrameworkPlan. what=summary (mcu + clocks + peripherals), clocks, gpio (per-pin config), peripherals (init blocks), init_order, or unresolved (the TODO holes that need target data or a design decision). Run design_framework first.","inputSchema":{"properties":{"session":{"description":"Target session id (default 'default').","type":"string"},"what":{"description":"summary|clocks|gpio|peripherals|init_order|unresolved (default summary).","type":"string"}},"type":"object"},"name":"describe_framework"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Render the synthesized FrameworkPlan to a HAL C init skeleton (bsp_init.c + bsp_init.h). Every derived fact (clock enables, GPIO modes, mapped .Init fields) is concrete; every unresolved value is a clearly marked TODO — nothing is fabricated. Returns the files, their content, and a todo_count. Run design_framework first.","inputSchema":{"properties":{"session":{"description":"Target session id (default 'default').","type":"string"},"style":{"description":"Code style (default 'hal').","type":"string"}},"type":"object"},"name":"render_framework"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Auto-derive a machine-checked AcceptanceSpec from the synthesized FrameworkPlan (Pillar D Tier 3) and load it as the session's acceptance judge — welding design synthesis to the acceptance loop. Always emits a no_fault check (init must not HardFault); adds a memory_u32 bits_set check per clock the plan enables (RCC enable bit), a memory_u32 bits_set check per interrupt the plan enables (arch-standard NVIC ISER bit, from the resolved IRQ number), and a masked memory_u32 eq check per configured pin (GPIO MODER = AF/analog; F1's CRL/CRH is skipped). Register/IRQ/port placements come from the session's loaded SVD or explicit register_map/irq_map/gpio_map; anything unresolvable is surfaced, never guessed. Each derived check also carries source provenance (the init function + line that should satisfy it), so a later failure points straight at the fix site. Run design_framework first; load an SVD (start_debug_session/set svd) for clock/NVIC/GPIO checks.","inputSchema":{"properties":{"gpio_map":{"description":"Optional explicit GPIO port bases {line_or_family: {port_letter: MODER_address}}; overrides the SVD.","type":"object"},"include_gpio":{"description":"Emit GPIO MODER checks for configured pins (default true).","type":"boolean"},"include_no_fault":{"description":"Emit the no_fault check (default true).","type":"boolean"},"include_nvic":{"description":"Emit NVIC ISER checks for enabled interrupts (default true).","type":"boolean"},"irq_map":{"description":"Optional explicit IRQ numbers {line_or_family: {irq_name: number}} (name with or without _IRQn); overrides the SVD.","type":"object"},"load":{"description":"Load the derived spec as the session acceptance judge (default true).","type":"boolean"},"name":{"description":"Optional spec name.","type":"string"},"register_map":{"description":"Optional explicit RCC placements {line_or_family: {clock: {address, bit}}}; overrides the SVD.","type":"object"},"session":{"description":"Target session id (default 'default').","type":"string"},"stopped_at":{"description":"Optional symbol to also assert the PC reached after init (e.g. 'main').","type":"string"}},"type":"object"},"name":"synthesize_acceptance"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Synthesize a concrete SystemClock_Config() for the session's FrameworkPlan (Pillar D Tier 3) - the last hand-written gap in generated init code. Given a clock source (HSE + crystal Hz, or HSI) and a target SYSCLK, it computes the exact PLL dividers (M/N/P or R, Q for 48 MHz USB), AHB/APB bus prescalers, and flash wait-states via pure datasheet math, then stores the result so the next render_framework emits real clock code instead of a TODO stub. Deterministic and honest: an unmodelled device or an infeasible target is surfaced, never guessed. Built-in profiles: STM32F401/F407/F411 and mainstream L4 (<=80 MHz); pass an explicit profile for others. Run design_framework first.","inputSchema":{"properties":{"load":{"description":"Store the solution into the plan so render_framework uses it (default true).","type":"boolean"},"need_48mhz":{"description":"Require an exact 48 MHz PLL output for USB/SDIO/RNG (default false).","type":"boolean"},"profile":{"description":"Optional explicit device profile; overrides the built-in table.","type":"object"},"session":{"description":"Target session id (default 'default').","type":"string"},"source":{"description":"Clock source: 'HSE' or 'HSI' (default 'HSI').","type":"string"},"source_hz":{"description":"HSE crystal frequency in Hz (required when source=HSE).","type":"integer"},"sysclk_hz":{"description":"Target SYSCLK in Hz (e.g. 168000000).","type":"integer"}},"type":"object"},"name":"solve_clock_tree"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Solve a timer's Prescaler/Period (PSC/ARR) for a target update frequency (Pillar D Tier 3). Turns intent ('TIM3 at 1 kHz') into concrete register values using the timer input clock (TIMxCLK) derived from the solved clock tree. Record a target via design_framework(design={'TIM3': {'update_hz': 1000}}) then run solve_clock_tree first, or pass timer_clock_hz directly for a what-if. Deterministic and honest: an exact target yields zero-error PSC/ARR, an inexact one yields the closest pair plus the achieved frequency and ppm error, and an unrepresentable target or an unknown timer bus is surfaced, never guessed. Injects the result into the plan so render_framework emits concrete values instead of a TODO.","inputSchema":{"properties":{"arr_bits":{"description":"ARR width override: 16 or 32 (for 32-bit timers TIM2/TIM5).","type":"integer"},"bus":{"description":"Override the timer's APB bus: 'apb1' or 'apb2'.","type":"string"},"load":{"description":"Persist the solved PSC/ARR into the plan (default true).","type":"boolean"},"session":{"description":"Target session id (default 'default').","type":"string"},"target_hz":{"description":"Target update frequency in Hz; overrides the recorded design target (requires timer).","type":"number"},"timer":{"description":"Timer to solve, e.g. 'TIM3'. Omit to solve every timer that has a recorded target.","type":"string"},"timer_clock_hz":{"description":"Explicit TIMxCLK in Hz; bypasses the clock-solution + bus derivation (pure what-if).","type":"integer"}},"type":"object"},"name":"solve_timer"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Register a verified device-fact pack (Pillar F) so the deterministic solvers cover a new STM32 family: its DMA request routing, irregular NVIC vectors, clock PLL profile, and timer bus/width. Facts are DATA, never guessed -- STM32F4/L4 ship built-in; add a family by supplying a validated pack (schema 'stm32-device-pack/v1') via path= (a JSON file) or inline pack=. Call with no arguments to report current coverage. Honest by design: a malformed pack is rejected with the list of problems and never half-loaded; shadowing a built-in family needs allow_override=true.","inputSchema":{"properties":{"allow_override":{"description":"Permit shadowing a built-in family pack (default false).","type":"boolean"},"pack":{"description":"Inline device-pack object (takes precedence over path).","type":"object"},"path":{"description":"Path to a device-pack JSON file to load and register.","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"type":"object"},"name":"load_device_pack"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Spec-to-silicon capstone (Pillar G): run the whole deterministic DESIGN half in one call. Chains the existing, individually verified tools in dependency order -- import_netlist? -> import_spec? -> design_framework -> solve_clock_tree? -> solve_timer? -> render_framework -> synthesize_acceptance -- turning a netlist plus a product spec into a flashable HAL skeleton and a machine-checked acceptance spec, then hands off to the build/verify loop. Optional stages (marked ?) run only when their input is present. Honest by construction: it GUESSES NOTHING -- it sequences verified tools and aggregates every stage's own unresolved/conflict gaps into one 'human decisions / data still needed' list. A required-stage hard error (no board, invalid input) stops with pipeline_status=blocked at that stage; expected gaps (an AF needing a pin DB, an unmodelled clock) surface as complete_with_unresolved; a clean run is complete. Operates on the session's board unless netlist= is supplied.","inputSchema":{"properties":{"acceptance_name":{"description":"Name for the derived acceptance spec.","type":"string"},"af_map":{"description":"Alternate-function map for GPIO AF resolution {line_or_family: {port_pin: {'PERIPH_SIG': af}}}.","type":"object"},"db_path":{"description":"Path to a pin-capability DB for AF resolution (else STM32_GDB_MCP_PIN_DB).","type":"string"},"design":{"description":"Peripheral config overrides merged into the design {PERIPH: {..}}.","type":"object"},"gpio_map":{"description":"GPIO base-address map for pin acceptance checks {line_or_family: {port_letter: base_address}}.","type":"object"},"irq_map":{"description":"IRQ-number map for NVIC acceptance checks {line_or_family: {irq_name: number}}.","type":"object"},"need_48mhz":{"description":"Require a 48 MHz domain (USB/SDMMC) in the clock solve.","type":"boolean"},"netlist":{"description":"Netlist to import first: {path|text, format?}. Omit to use the board already in this session.","type":"object"},"register_map":{"description":"Clock-enable register map for acceptance placement {line_or_family: {clock: {address, bit}}}.","type":"object"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"source":{"description":"Clock source for solve_clock_tree (e.g. hse/hsi).","type":"string"},"source_hz":{"description":"Clock source frequency in Hz for solve_clock_tree.","type":"integer"},"spec":{"description":"Product spec object to import and design from (import_spec).","type":"object"},"stopped_at":{"description":"Symbol the acceptance spec should assert the core halts at.","type":"string"},"style":{"description":"Render style for the framework skeleton (default hal).","type":"string"},"synthesize":{"description":"Set false to stop after render_framework and skip acceptance synthesis (default true).","type":"boolean"},"sysclk_hz":{"description":"Target SYSCLK in Hz; presence enables the solve_clock_tree stage.","type":"integer"}},"type":"object"},"name":"run_pipeline"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Firmware log capture over a channel. action=start(channel[,port,baudrate,command,args,file,timeout]) | stop(channel) | get(channel[,limit,since_index,clear]) | clear(channel). channel=rtt|swo|uart; uart takes port/baudrate, rtt/swo take command/args or file.","inputSchema":{"oneOf":[{"properties":{"action":{"const":"start"}},"required":["action","channel"],"title":"start"},{"properties":{"action":{"const":"stop"}},"required":["action","channel"],"title":"stop"},{"properties":{"action":{"const":"get"}},"required":["action","channel"],"title":"get"},{"properties":{"action":{"const":"clear"}},"required":["action","channel"],"title":"clear"}],"properties":{"action":{"description":"Which operation to perform.","enum":["start","stop","get","clear"],"type":"string"},"args":{"description":"rtt/swo: command arguments.","items":{"type":"string"},"type":"array"},"baudrate":{"description":"uart: baudrate (default 115200).","type":"integer"},"channel":{"description":"Log channel.","enum":["rtt","swo","uart"],"type":"string"},"clear":{"description":"Clear returned entries after reading.","type":"boolean"},"command":{"description":"rtt/swo: executable to launch (rtt defaults to JLinkRTTClient).","type":"string"},"file":{"description":"swo: tail OpenOCD's ITM decode file (run setup_swo first) — no external decoder needed.","type":"string"},"limit":{"description":"Max recent entries to return.","type":"integer"},"port":{"description":"uart: serial port, e.g. COM3 or /dev/ttyUSB0.","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"since_index":{"description":"Only entries with index greater than this.","type":"integer"},"timeout":{"description":"uart: read timeout seconds (default 0.1).","type":"number"}},"required":["action"],"type":"object"},"name":"logging"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Breakpoint / watchpoint management. action=set(location[,condition,temporary,ignore_count]) | delete(breakpoint_id) | list | watch(location,access_type). access_type=r|w|a.","inputSchema":{"oneOf":[{"properties":{"action":{"const":"set"}},"required":["action","location"],"title":"set"},{"properties":{"action":{"const":"delete"}},"required":["action","breakpoint_id"],"title":"delete"},{"properties":{"action":{"const":"list"}},"required":["action"],"title":"list"},{"properties":{"action":{"const":"watch"},"location":{"description":"Variable or address to watch.","type":"string"}},"required":["action","location","access_type"],"title":"watch"}],"properties":{"access_type":{"description":"Read (r), Write (w), or Access (a).","enum":["r","w","a"],"type":"string"},"action":{"description":"Which operation to perform.","enum":["set","delete","list","watch"],"type":"string"},"breakpoint_id":{"description":"ID of the breakpoint to delete (e.g., '1').","type":"string"},"condition":{"description":"Optional C expression; break only when it is non-zero, e.g. 'count > 5'.","type":"string"},"ignore_count":{"description":"Number of hits to ignore before stopping.","type":"integer"},"location":{"description":"Location to break at, e.g., 'main', 'main.c:42', or '*0x08001000'.","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"temporary":{"description":"If true, the breakpoint is deleted after its first hit.","type":"boolean"}},"required":["action"],"type":"object"},"name":"breakpoint"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Evaluate C/GDB expressions. action=assert(assertions) | capture([expressions,table]) | compare(expressions,action). assertions=[{expression,expected[,operator]}]; table={index_range,columns}; compare runs 'action' between the two captures.","inputSchema":{"oneOf":[{"properties":{"action":{"const":"assert"}},"required":["action","assertions"],"title":"assert"},{"properties":{"action":{"const":"capture"}},"required":["action"],"title":"capture"},{"properties":{"action":{"enum":["step_over","step_into","continue","halt","reset_halt"],"type":"string"}},"required":["action","expressions"],"title":"compare"}],"properties":{"action":{"description":"Which operation to perform.","enum":["assert","capture","compare"],"type":"string"},"assertions":{"items":{"properties":{"expected":{},"expression":{"type":"string"},"operator":{"enum":["==","!=",">",">=","<","<="],"type":"string"}},"required":["expression","expected"],"type":"object"},"type":"array"},"expressions":{"description":"GDB/C expressions to evaluate.","items":{"type":"string"},"type":"array"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"table":{"description":"Optional indexed table request, e.g. columns=['count'], index_range=[2,6].","properties":{"columns":{"description":"Expression prefixes; each cell reads prefix[index].","items":{"type":"string"},"type":"array"},"index_range":{"description":"Inclusive [start, end] index range.","items":{"type":"integer"},"type":"array"}},"type":"object"}},"required":["action"],"type":"object"},"name":"expressions"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Core-dump capture / load. action=capture(path) | load(path).","inputSchema":{"oneOf":[{"properties":{"action":{"const":"capture"}},"required":["action","path"],"title":"capture"},{"properties":{"action":{"const":"load"},"path":{"description":"Path to the core file.","type":"string"}},"required":["action","path"],"title":"load"}],"properties":{"action":{"description":"Which operation to perform.","enum":["capture","load"],"type":"string"},"path":{"description":"Output path for the core file.","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"required":["action"],"type":"object"},"name":"coredump"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"GDB operation timeouts. action=get | set(overrides). overrides={connect,reset,memory,...} in seconds.","inputSchema":{"oneOf":[{"properties":{"action":{"const":"get"}},"required":["action"],"title":"get"},{"properties":{"action":{"const":"set"}},"required":["action","overrides"],"title":"set"}],"properties":{"action":{"description":"Which operation to perform.","enum":["get","set"],"type":"string"},"overrides":{"description":"Map of timeout name -> seconds, e.g. {\"memory\": 4.0, \"connect\": 8.0}.","type":"object"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"required":["action"],"type":"object"},"name":"timeouts"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Debug-config file (.json) management. action=load(path) | save(path,config) | validate(config).","inputSchema":{"oneOf":[{"properties":{"action":{"const":"load"}},"required":["action","path"],"title":"load"},{"properties":{"action":{"const":"save"},"path":{"description":"Destination YAML config path.","type":"string"}},"required":["action","path","config"],"title":"save"},{"properties":{"action":{"const":"validate"},"config":{"description":"Config object to validate.","type":"object"}},"required":["action","config"],"title":"validate"}],"properties":{"action":{"description":"Which operation to perform.","enum":["load","save","validate"],"type":"string"},"config":{"description":"Config object to save.","type":"object"},"path":{"description":"Path to a YAML debug config file.","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"required":["action"],"type":"object"},"name":"debug_config"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Active debug profile (mcu/elf/svd/probe). action=get | set([mcu,elf_path,svd_path,board,probe,server_type,server_args,project_root,hub,notes,merge]). set merges at the TOP LEVEL ONLY: omitted fields keep their value, but a nested block you pass REPLACES the stored one whole — hub={map:{3:{label:TC}}} drops the rest of hub, including what hub(action=discover) wrote. merge=true deep-merges nested blocks instead; leave it off to DROP a stale entry, since replace is the only way to remove one. Returns the full resulting profile, which is in-memory only: empty again after the MCP server restarts.","inputSchema":{"oneOf":[{"properties":{"action":{"const":"get"}},"required":["action"],"title":"get"},{"properties":{"action":{"const":"set"}},"required":["action"],"title":"set"}],"properties":{"action":{"description":"Which operation to perform.","enum":["get","set"],"type":"string"},"board":{"type":"string"},"elf_path":{"type":"string"},"hub":{"description":"Programmable USB hub binding: {port, serial, channel, map, power_cycle, guard}. channel is 1-based and selects which port this session's board sits on.","type":"object"},"mcu":{"type":"string"},"merge":{"description":"Deep-merge nested blocks (hub, rtt, uart, swo, reset, hil) into the stored ones instead of replacing them -- use it to add one key, e.g. a hub.map label, without dropping the identity hub(action=discover) wrote. Leave it off to replace, which is the only way to remove a stale entry.","type":"boolean"},"notes":{"type":"string"},"probe":{"type":"string"},"project_root":{"type":"string"},"server_args":{"items":{"type":"string"},"type":"array"},"server_type":{"enum":["openocd","stlink","jlink"],"type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"svd_path":{"type":"string"}},"required":["action"],"type":"object"},"name":"debug_profile"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Read CPU register groups. what=core([include_raw]) | fault | cycle([enable]). fault decodes CFSR/HFSR; cycle reads the DWT cycle counter.","inputSchema":{"oneOf":[{"properties":{"what":{"const":"core"}},"required":["what"],"title":"core"},{"properties":{"what":{"const":"fault"}},"required":["what"],"title":"fault"},{"properties":{"what":{"const":"cycle"}},"required":["what"],"title":"cycle"}],"properties":{"enable":{"description":"If true, enable and zero the counter before reading.","type":"boolean"},"include_raw":{"description":"Include the raw GDB transcript (default false).","type":"boolean"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"what":{"description":"Which operation to perform.","enum":["core","fault","cycle"],"type":"string"}},"required":["what"],"type":"object"},"name":"read_registers"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Symbol / type introspection. what=size(expr) | type(expr) | address(symbol) | resolve(expr) | functions([regex]) | variables([regex]). resolve maps an address back to source, returning {resolved,symbol,offset,section,file,line}; resolved=false means no symbol there.","inputSchema":{"oneOf":[{"properties":{"what":{"const":"size"}},"required":["what","expr"],"title":"size"},{"properties":{"expr":{"description":"Expression or type name, e.g. 'my_struct' or 'g_state'.","type":"string"},"what":{"const":"type"}},"required":["what","expr"],"title":"type"},{"properties":{"what":{"const":"address"}},"required":["what","symbol"],"title":"address"},{"properties":{"expr":{"description":"Address or expression to resolve, e.g. '$pc' or '0x08001234'. Required (or pass it as 'address').","type":"string"},"what":{"const":"resolve"}},"required":["what"],"title":"resolve"},{"properties":{"what":{"const":"functions"}},"required":["what"],"title":"functions"},{"properties":{"regex":{"description":"Optional regex to filter variable names.","type":"string"},"what":{"const":"variables"}},"required":["what"],"title":"variables"}],"properties":{"address":{"description":"Alias for 'expr'.","type":"string"},"expr":{"description":"Type or expression to size, e.g. 'struct foo'.","type":"string"},"regex":{"description":"Optional regex to filter function names.","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"symbol":{"description":"Symbol name, e.g. 'g_state'.","type":"string"},"what":{"description":"Which operation to perform.","enum":["size","type","address","resolve","functions","variables"],"type":"string"}},"required":["what"],"type":"object"},"name":"inspect_symbol"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Typed (struct-aware) memory access. action=read(address,width_bits,count) | write(address,value,width_bits). width_bits=8|16|32|64.","inputSchema":{"oneOf":[{"properties":{"action":{"const":"read"}},"required":["action","address","width_bits","count"],"title":"read"},{"properties":{"action":{"const":"write"},"address":{"description":"Hex address to write to, e.g., '0x20000000'.","type":"string"}},"required":["action","address","value","width_bits"],"title":"write"}],"properties":{"action":{"description":"Which operation to perform.","enum":["read","write"],"type":"string"},"address":{"description":"Hex address to read from, e.g., '0x20000000'.","type":"string"},"count":{"description":"Number of elements to read.","type":"integer"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"value":{"description":"Value to write, e.g., '0x12345678'.","type":"string"},"width_bits":{"description":"Element width in bits.","enum":[8,16,32,64],"type":"integer"}},"required":["action"],"type":"object"},"name":"typed_memory"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Memory-write guardrail. action=policy([mode,add_allow,add_protected]) | audit([limit]). mode=enforce|dry_run.","inputSchema":{"oneOf":[{"properties":{"action":{"const":"policy"}},"required":["action"],"title":"policy"},{"properties":{"action":{"const":"audit"}},"required":["action"],"title":"audit"}],"properties":{"action":{"description":"Which operation to perform.","enum":["policy","audit"],"type":"string"},"add_allow":{"description":"Regions to explicitly allow, overriding protection.","items":{"properties":{"end":{"type":"integer"},"name":{"type":"string"},"start":{"type":"integer"}},"type":"object"},"type":"array"},"add_protected":{"description":"Additional regions to protect from writes.","items":{"properties":{"end":{"type":"integer"},"name":{"type":"string"},"start":{"type":"integer"}},"type":"object"},"type":"array"},"limit":{"description":"Return only the most recent N entries.","type":"integer"},"mode":{"description":"Guard mode.","enum":["enforce","dry_run"],"type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"required":["action"],"type":"object"},"name":"write_guard"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"One-shot diagnostic snapshot. scope=full([include_project,include_rtos,include_logs,log_limit,project_root]) | rtos. full bundles registers+stack+faults; rtos captures task/queue state.","inputSchema":{"oneOf":[{"properties":{"scope":{"const":"full"}},"required":["scope"],"title":"full"},{"properties":{"scope":{"const":"rtos"}},"required":["scope"],"title":"rtos"}],"properties":{"include_logs":{"description":"Include captured RTT logs.","type":"boolean"},"include_project":{"description":"Include project discovery context.","type":"boolean"},"include_rtos":{"description":"Include FreeRTOS runtime context.","type":"boolean"},"log_limit":{"description":"Maximum number of RTT log entries to include.","type":"integer"},"project_root":{"description":"Optional project root for discovery.","type":"string"},"scope":{"description":"Which operation to perform.","enum":["full","rtos"],"type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"required":["scope"],"type":"object"},"name":"snapshot"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Stack-frame navigation. action=select(level) | source([location,count]) | variables([level,include_raw]). level 0 is the innermost frame.","inputSchema":{"oneOf":[{"properties":{"action":{"const":"select"}},"required":["action","level"],"title":"select"},{"properties":{"action":{"const":"source"}},"required":["action"],"title":"source"},{"properties":{"action":{"const":"variables"},"level":{"description":"Optional frame level to select first (0 = innermost).","type":"integer"}},"required":["action"],"title":"variables"}],"properties":{"action":{"description":"Which operation to perform.","enum":["select","source","variables"],"type":"string"},"count":{"description":"Approximate number of lines (default 10).","type":"integer"},"include_raw":{"description":"Include the raw GDB transcript (default false).","type":"boolean"},"level":{"description":"Frame level, 0 is the innermost/current frame.","type":"integer"},"location":{"description":"Where to list around. Omit to continue from current.","type":"string"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"}},"required":["action"],"type":"object"},"name":"frame"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Session/transport diagnostics. what=health([reconnect]) | events | server_logs. events returns recent GDB/MI records; server_logs returns the GDB server's stderr.","inputSchema":{"oneOf":[{"properties":{"what":{"const":"health"}},"required":["what"],"title":"health"},{"properties":{"what":{"const":"events"}},"required":["what"],"title":"events"},{"properties":{"what":{"const":"server_logs"}},"required":["what"],"title":"server_logs"}],"properties":{"reconnect":{"description":"If true, try to reconnect the GDB client to the running server.","type":"boolean"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"what":{"description":"Which operation to perform.","enum":["health","events","server_logs"],"type":"string"}},"required":["what"],"type":"object"},"name":"session_diagnostics"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Programmable USB hub: per-port power, USB2 data lines, cold boot, and V/I sampling. action=describe | power(state[,channel,confirm]) | data(state[,channel,exclusive,confirm]) | cycle([channel,off_ms,settle_ms,confirm]) | measure([channel,duration_sec,interval_sec,all_channels]) | discover([apply,force,settle_sec]) | dashboard([state,port,interval_sec,open_browser]). dashboard serves a read-only live web page on 127.0.0.1 and returns its URL. state=on|off; channel is 1-based and defaults to the session's mapped hub channel. Removing port power cold-boots that board and un-enumerates its probe.","inputSchema":{"oneOf":[{"properties":{"action":{"const":"describe"}},"required":["action"],"title":"describe"},{"properties":{"action":{"const":"power"}},"required":["action","state"],"title":"power"},{"properties":{"action":{"const":"data"}},"required":["action","state"],"title":"data"},{"properties":{"action":{"const":"cycle"}},"required":["action"],"title":"cycle"},{"properties":{"action":{"const":"measure"}},"required":["action"],"title":"measure"},{"properties":{"action":{"const":"discover"}},"required":["action"],"title":"discover"},{"properties":{"action":{"const":"dashboard"},"interval_sec":{"description":"Seconds between hub samples (default 1.0, min 0.2).","type":"number"},"state":{"description":"on (default) starts or re-points the dashboard; off stops it.","enum":["on","off"],"type":"string"}},"required":["action"],"title":"dashboard"}],"properties":{"action":{"description":"Which operation to perform.","enum":["describe","power","data","cycle","measure","discover","dashboard"],"type":"string"},"all_channels":{"description":"Sample every channel instead of just one.","type":"boolean"},"apply":{"description":"Write the discovered map into the debug profile.","type":"boolean"},"channel":{"description":"1-based hub channel. Defaults to the session's mapped hub channel.","type":"integer"},"confirm":{"description":"Required to cut power/data when the guard is in confirm mode or a session is live.","type":"boolean"},"duration_sec":{"description":"Sampling window; 0 (default) takes one snapshot.","type":"number"},"exclusive":{"description":"With state=on, disconnect every other port's data line.","type":"boolean"},"force":{"description":"Run even though a GDB server is alive on this session.","type":"boolean"},"interval_sec":{"description":"Delay between samples (default 0.05).","type":"number"},"off_ms":{"description":"Milliseconds to hold power off (default 400).","type":"integer"},"open_browser":{"description":"Also open the page in the default browser.","type":"boolean"},"port":{"description":"HTTP port on 127.0.0.1 (default 8765).","type":"integer"},"session":{"description":"Optional debug-session name. Omit for the default target.","type":"string"},"settle_ms":{"description":"Milliseconds to wait after restoring power (default 1500).","type":"integer"},"settle_sec":{"description":"Seconds to wait for USB re-enumeration per toggle (default 1.0).","type":"number"},"state":{"description":"Target state for the port.","enum":["on","off"],"type":"string"}},"required":["action"],"type":"object"},"name":"hub"}]}}}
