Skip to main content
Glama

start_debug_session

Start an STM32 GDB debug session by launching OpenOCD, ST-Link, or J-Link and connecting the GDB client, with profile defaults or supplied probe/session options.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
probeNoOptional OpenOCD probe type: stlink, jlink, or cmsis-dap. Falls back to the profile, then a unique detected probe.
serialNoProbe/ST-Link serial to select a specific board (for concurrent multi-target). Auto-added as 'adapter serial <serial>'.
sessionNoOptional debug-session name. Omit for the default target.
speed_khzNoOpenOCD adapter clock used when server_args are inferred (default 4000).
hub_channelNoTake 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.
server_argsNoOptional args for the server e.g. ['-f', 'interface/stlink.cfg', '-f', 'target/stm32f4x.cfg']
server_typeNoType of debug server backend.
usb_locationNoSelect 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.15.1

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare the non-read-only, non-idempotent, non-destructive profile, so the bar is lower; the description still adds value by disclosing a concrete failure mode (OpenOCD without server_args) and the fallback chain to the active profile. It does not say what happens to an already-running server/session, whether a process is spawned, or how failures surface, so it falls short of full disclosure.

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

Conciseness5/5

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

Purpose is front-loaded in the first clause, followed by the one constraint an agent will most likely trip over and a formatting example. Three sentences, no restatement of the name and no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter, zero-required session-start tool with no output schema, the description covers the essential call-shaping information (backend choice, mandatory openocd args, profile fallbacks). It leaves unclear the interaction with stop_debug_session/close_session and whether a prior session must be closed first, which is the main remaining gap.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description genuinely adds meaning beyond it: it flags that server_args are mandatory for openocd (the schema calls them merely 'optional'), names the required -f interface/target form, and explains that unspecified parameters are resolved from the active debug profile.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Gives a specific verb (starts) plus two concrete resources (the GDB server and the GDB client connection) and enumerates the supported backends (openocd, stlink, jlink). An agent immediately knows what the tool does, though it never names a sibling such as stop_debug_session or detect_probe to disambiguate the session lifecycle.

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

Usage Guidelines3/5

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

The description supplies a real precondition — OpenOCD cannot run without server_args naming probe and target, with a concrete example — and notes that omitted values fall back to the active debug profile. However, it gives no guidance on when to prefer this over adjacent tools (suggest_server_args, detect_probe, hub, recover_session); usage is implied rather than routed.

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