Skip to main content
Glama

debug_connect

Connect to a QEMU gdbstub and register the debugging session under a name, optionally loading an ELF for symbol and source-level breakpoints while the target stays halted.

Instructions

Connect to a gdbstub and register the session under name.

For QEMU, start it with -s (stub on tcp::1234) or -gdb tcp::PORT, and add -S to halt the CPU before the first instruction so you can set breakpoints before anything runs. With qemu-mcp, pass these via qemu_boot's extra_args, e.g. extra_args="-s -S". elf is the kernel image with symbols (and ideally DWARF debug info); it enables symbol names, file:line breakpoints and source locations. load_bias is added to every ELF address, for images loaded somewhere other than their link address (0 for a normally linked kernel). The target stays halted after connecting.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>"
    },
    "name": "debug_connect"
  }
}

Input Schema

NameRequiredDescriptionDefault
elfNo
hostNo127.0.0.1
nameYes
portNo
load_biasNo
timeout_sNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden; it discloses the important post-condition that the target stays halted after connecting and that `elf` enables symbol resolution. It omits what happens on connection failure, whether reusing an existing `name` overwrites a session, and what timeout_s governs — meaningful gaps for a session-creating tool.

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 prerequisites, then per-parameter notes. The QEMU block is somewhat provider-specific but each sentence supplies operational value; no filler.

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

Completeness3/5

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

An output schema exists, so return values need not be explained, and the attach semantics are well covered. Still missing for a 6-parameter session tool with zero schema descriptions: timeout behavior, duplicate-name handling, and whether the session must be ended with debug_disconnect.

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 description coverage is 0% across 6 parameters, so the description must compensate; it explains `elf` (symbols/DWARF), `load_bias` (added to every ELF address, 0 for normally linked kernels) and implicitly host/port via the QEMU tcp::1234 example. It adds nothing for `timeout_s`, and `name` is only sketched as the session key without collision or lifecycle rules.

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 action and resource: 'Connect to a gdbstub and register the session under `name`.' The session-registration detail plus the named parameter distinguishes it cleanly from debug_disconnect and debug_sessions.

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

Usage Guidelines4/5

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

Gives concrete setup context for QEMU (`-s`, `-gdb tcp::PORT`, `-S` to halt before the first instruction) and shows how to route those flags through qemu_boot's extra_args. It sets up the precondition for wanting this tool rather than a sibling, but never names a sibling or states when to prefer debug_sessions/disconnect instead.

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