Skip to main content
Glama
sbergeron42

gdb-multiarch-mcp

by sbergeron42

gdb_select_frame

Select a specific stack frame during debugging to examine variables and execution context at that point in the call stack.

Instructions

Select a specific stack frame.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
frame_numberYesFrame number (0 is current/innermost frame)

Implementation Reference

  • The select_frame handler in GDBSession class that uses -stack-select-frame.
    def select_frame(self, frame_number: int) -> dict[str, Any]:
        """
        Select a specific stack frame to make it the current frame.
    
        Args:
            frame_number: Frame number (0 is innermost/current frame)
    
        Returns:
            Dict with status and frame information
        """
        result = self.execute_command(f"-stack-select-frame {frame_number}")
    
        if result["status"] == "error":
            return result
    
        # Get info about the selected frame
        frame_info_result = self.execute_command("-stack-info-frame")
    
        if frame_info_result["status"] == "error":
            return {
                "status": "success",
                "frame_number": frame_number,
                "message": f"Frame {frame_number} selected",
            }
    
        mi_result = self._extract_mi_result(frame_info_result) or {}
        frame_info = mi_result.get("frame", {})
    
        return {
            "status": "success",
            "frame_number": frame_number,
            "frame": frame_info,
        }
  • Input schema for gdb_select_frame tool.
    class FrameSelectArgs(BaseModel):
        frame_number: int = Field(..., description="Frame number (0 is current/innermost frame)")
  • Registration of gdb_select_frame tool.
    Tool(
        name="gdb_select_frame",
        description="Select a specific stack frame.",
        inputSchema=FrameSelectArgs.model_json_schema(),
    ),
Behavior2/5

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

No annotations are provided, so the description must carry the full burden of behavioral disclosure. While 'Select' implies state mutation, the description fails to explain that this changes the current evaluation context for variable inspection and that the selection persists until changed or execution resumes.

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 single sentence is efficient and front-loaded with no redundant words. However, the extreme brevity leaves significant behavioral and contextual information unstated, making it slightly too concise for the complexity of GDB debugging operations.

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?

Given the complex debugging domain with numerous sibling tools and no output schema or annotations, the description is insufficiently complete. It should explain that frame selection scopes subsequent variable queries and expression evaluations, and clarify the relationship to backtrace navigation.

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?

With 100% schema description coverage for the single frame_number parameter, the schema already documents the 0-indexing convention and meaning. The description adds no supplemental parameter guidance, 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 provides a clear verb ('Select') and resource ('stack frame'), making the basic function unambiguous. However, it lacks differentiation from sibling inspection tools like gdb_get_frame_info, which also interact with frames but without changing debugger context.

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 offers no guidance on when to use this tool versus alternatives like gdb_get_frame_info or gdb_get_backtrace. It omits crucial context that frame selection affects subsequent variable inspection and expression evaluation contexts.

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