Skip to main content
Glama
sbergeron42

gdb-multiarch-mcp

by sbergeron42

gdb_get_backtrace

Retrieve stack backtraces for debugging Nintendo Switch executables using GDB to analyze program flow and identify issues during execution.

Instructions

Get the stack backtrace (standard GDB backtrace).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thread_idNoThread ID (None for current thread)
max_framesNoMaximum number of frames to retrieve

Implementation Reference

  • The `get_backtrace` method in `GDBSession` class. This method switches to the specified thread (if any) and then retrieves the backtrace using the GDB/MI `-stack-list-frames` command.
    def get_backtrace(
        self, thread_id: Optional[int] = None, max_frames: int = DEFAULT_MAX_BACKTRACE_FRAMES
    ) -> dict[str, Any]:
        """
        Get the stack backtrace for a specific thread or the current thread.
    
        Args:
            thread_id: Thread ID to get backtrace for (None for current thread)
            max_frames: Maximum number of frames to retrieve
    
        Returns:
            Dict with backtrace information
        """
        # Switch to thread if specified
        if thread_id is not None:
            switch_result = self.execute_command(f"-thread-select {thread_id}")
            if switch_result["status"] == "error":
                return switch_result
    
        # Get stack trace
        result = self.execute_command(f"-stack-list-frames 0 {max_frames}")
    
        if result["status"] == "error":
            return result
    
        stack_data = self._extract_mi_result(result) or {}
        frames = stack_data.get("stack", [])
    
        return {"status": "success", "thread_id": thread_id, "frames": frames, "count": len(frames)}
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but fails to specify whether this is read-only, what format the backtrace returns in (string vs structured data), or whether it affects debugger state. The phrase 'standard GDB backtrace' implies text output but lacks explicit confirmation.

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?

The description is a single, front-loaded sentence with no redundant words. However, given the lack of annotations and output schema, extreme brevity becomes a liability rather than a virtue, as critical behavioral context is omitted.

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

Completeness2/5

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

Without an output schema or annotations, the description should specify the return format (e.g., 'returns a formatted string representation of the call stack'). It also omits thread safety notes and whether the operation is non-destructive, leaving significant gaps for a debugging tool.

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?

The input schema has 100% description coverage (thread_id and max_frames are both clearly documented), so the description doesn't need to add parameter details. It neither supplements nor contradicts the schema, meeting the baseline expectation for high-coverage schemas.

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?

The description clearly states the tool retrieves a 'stack backtrace' and specifies it's the 'standard GDB backtrace,' which helps distinguish it from sibling tools like switch_my_bt. However, it doesn't differentiate from gdb_get_frame_info, which retrieves specific frame details rather than the full stack trace.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives such as gdb_get_frame_info (for single frame details) or the switch_* backtrace variants. No prerequisites, exclusions, or contextual triggers are mentioned.

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