Skip to main content
Glama

recover_session

Restores a dropped or wedged STM32 GDB debug session by tearing down and restarting the server, reconnecting, and escalating to USB hub power cycling if needed.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deepNoAdd a long (2 s) power-off rung to drain bulk capacitance.
sessionNoOptional debug-session name. Omit for the default target.
escalateNoAllow hub data-line/power escalation when a plain retry fails (default true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.15.1

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond the annotations (which only flag readOnly/destructive/idempotent false) by disclosing what gets torn down and restarted, retry/backoff behavior, hub data-line toggling and power-cycling escalation, and that hub actions are reported in recovery_steps. Rich operational context an agent could not get from structured fields.

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

Conciseness4/5

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

Front-loaded with the core action, then the trigger, then the hub escalation, then the reporting note. Dense but every sentence carries information; only slightly verbose in the hub explanation.

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 a complex recovery tool with no output schema, it covers trigger, mechanism, escalation, and result reporting. Annotations supply the safety profile, so remaining gaps are minor.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already documents deep, session, and escalate. The description explains the escalation concept but does not add parameter-specific syntax or format detail beyond the schema, so the baseline 3 is appropriate.

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

Purpose5/5

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

States a specific verb (recovers) and resource (session) and details the exact mechanism: tear down GDB client/server, restart server, reconnect. This clearly distinguishes it from siblings like close_session, stop_debug_session, or start_debug_session.

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

Usage Guidelines4/5

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

Explicitly gives the trigger condition: 'Use after a probe_unavailable or connection_lost error.' It also describes the escalation path when a hub is configured. It stops short of naming an alternative tool to use instead when recovery is not the right call.

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