Skip to main content
Glama
sbergeron42

gdb-multiarch-mcp

by sbergeron42

gdb_interrupt

Pause a running Nintendo Switch program during debugging with gdb-multiarch to inspect execution state and analyze code behavior.

Instructions

Interrupt (pause) a running program.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `interrupt` method in `GDBSession` implements the logic for sending a SIGINT signal to the GDB process to pause the target program.
    def interrupt(self) -> dict[str, Any]:
        """
        Interrupt (pause) a running program.
    
        This sends SIGINT to the GDB process, which pauses the debugged program.
        Use this when the program is running and you want to pause it to inspect
        state, set breakpoints, or perform other debugging operations.
    
        Returns:
            Dict with status and message
        """
        if not self.controller:
            return {"status": "error", "message": "No active GDB session"}
    
        if not self.controller.gdb_process:
            return {"status": "error", "message": "No GDB process running"}
    
        try:
            # Send SIGINT to pause the running program
            os.kill(self.controller.gdb_process.pid, signal.SIGINT)
    
            # Poll for *stopped notification with timeout
            # This avoids arbitrary sleep and responds as soon as GDB confirms the stop
            start_time = time.time()
            all_responses: list[dict[str, Any]] = []
            stopped_received = False
    
            while time.time() - start_time < INTERRUPT_RESPONSE_TIMEOUT_SEC:
                responses = self.controller.get_gdb_response(
                    timeout_sec=POLL_TIMEOUT_SEC, raise_error_on_timeout=False
                )
    
                if responses:
                    all_responses.extend(responses)
                    # Check for *stopped notification
                    for resp in responses:
                        if resp.get("type") == "notify" and resp.get("message") == "stopped":
                            stopped_received = True
                            break
    
                if stopped_received:
                    break
    
            result = self._parse_responses(all_responses)
    
            if not stopped_received:
                return {
                    "status": "warning",
                    "message": "Interrupt sent but no stopped notification received",
                    "result": result,
                }
    
            return {
                "status": "success",
                "message": "Program interrupted (paused)",
                "result": result,
            }
        except Exception as e:
            logger.error(f"Failed to interrupt program: {e}")
            return {"status": "error", "message": f"Failed to interrupt: {str(e)}"}
  • The `gdb_interrupt` tool is registered in the list of available tools in `server.py`.
    Tool(
        name="gdb_interrupt",
        description="Interrupt (pause) a running program.",
        inputSchema=NO_ARGS_SCHEMA,
    ),
  • The tool handler in `server.py` dispatches the `gdb_interrupt` request to the `session.interrupt()` method.
    elif name == "gdb_interrupt":
        result = session.interrupt()
Behavior3/5

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

No annotations are provided, so the description carries full disclosure burden. It indicates the program will pause, but omits key behavioral details: whether the interruption preserves program state for later continuation, where exactly execution stops (current PC vs breakpoint), and what the tool returns (status, frame info, or void).

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?

Extremely efficient at three words plus parenthetical clarification. Every element serves a purpose: 'Interrupt' names the action, '(pause)' clarifies the effect, and 'a running program' identifies the target. No redundancy or wasted text.

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?

For a zero-parameter debugging primitive, the description is minimally adequate, but gaps remain given the lack of annotations and output schema. It should ideally clarify that the program enters a stopped state awaiting further commands, and whether this maps to sending SIGINT or a soft pause.

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?

The input schema contains zero parameters, establishing a baseline score of 4. The description appropriately requires no parameter elaboration since the interrupt action is typically unconditional in GDB contexts.

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?

Description uses specific verbs ('Interrupt (pause)') and identifies the target resource ('a running program'). It clearly distinguishes from sibling tools like gdb_continue (resume), gdb_step (single step), and gdb_get_status (inspection) by emphasizing the pause action on active execution.

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 provides implied usage context (pause vs. continue), but lacks explicit guidance on when to use this versus gdb_step or gdb_next, and doesn't mention prerequisites like 'only works when a program is currently running' or the resulting stopped state.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sbergeron42/gdb-multiarch-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server