Skip to main content
Glama

gdb_start

Start a new GDB debugging session to analyze and debug programs through execution control, memory examination, and stack analysis.

Instructions

Start a new GDB debugging session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gdb_pathNogdb

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:81-86 (handler)
    The main handler function for the 'gdb_start' tool. Registered with @mcp.tool() decorator, it calls _get_gdb_tools().start_session(gdb_path) to start a new GDB debugging session and returns a success message with the session ID or an error message.
    def gdb_start(gdb_path: str = "gdb") -> str:
        """Start a new GDB debugging session."""
        try:
            return _get_gdb_tools().start_session(gdb_path)
        except Exception as e:
            return f"Error: {str(e)}"
  • The actual implementation of start_session in the GDBTools class. Creates a GDB session by calling sessionManager.create_session(gdb_path) and returns a formatted success message with the session ID. Wrapped with @handle_gdb_errors decorator for error handling.
    def start_session(self, gdb_path: str = "gdb") -> str:
        session_id = self.sessionManager.create_session(gdb_path)
        return f"GDB session started successfully. Session ID: {session_id}"
  • server.py:80-86 (registration)
    Registration point where the gdb_start tool is registered with the MCP server using the @mcp.tool() decorator from FastMCP. The decorator automatically creates the tool schema from the function signature (gdb_path: str = 'gdb', returns str).
    @mcp.tool()
    def gdb_start(gdb_path: str = "gdb") -> str:
        """Start a new GDB debugging session."""
        try:
            return _get_gdb_tools().start_session(gdb_path)
        except Exception as e:
            return f"Error: {str(e)}"
  • Helper function _get_gdb_tools that implements a singleton pattern to get a GDBTools instance. Uses DebuggerFactory.create_tools('gdb') to create the tools instance on first call and caches it for subsequent calls.
    def _get_gdb_tools():
        """Helper function to get GDB tools with error handling and singleton pattern."""
        global _gdb_tools_instance
        if _gdb_tools_instance is None:
            try:
                _gdb_tools_instance, _ = DebuggerFactory.create_tools('gdb')
            except Exception as e:
                raise RuntimeError(f"GDB not available: {str(e)}")
        return _gdb_tools_instance
  • The create_session method in GDBSessionManager that actually creates a GDB session. Generates a unique session ID, creates a GdbController instance with the GDB interpreter, stores it in the sessions dictionary, and returns the session ID.
    def create_session(self, gdb_path: str = "gdb") -> str:
        session_id = str(uuid.uuid4())
        try:
            gdb_controller = GdbController(command=[gdb_path, "--interpreter=mi3"])
            self.sessions[session_id] = gdb_controller
            logger.info(f"Started GDB session: {session_id}")
            return session_id
        except Exception as e:
            logger.error(f"Failed to start GDB session: {e}")
            raise
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Start') but doesn't explain what this entails—whether it launches a new process, attaches to an existing one, requires specific permissions, has side effects like consuming system resources, or what the expected output looks like. This leaves significant gaps for an agent to understand the tool's behavior.

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?

The description is a single, clear sentence that directly states the tool's purpose without any unnecessary words. It's front-loaded and efficiently communicates the core action, making it easy to parse quickly.

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 complexity of starting a debugging session (which involves system interactions and potential side effects), no annotations, and an output schema that exists but isn't detailed here, the description is incomplete. It lacks crucial context like what the tool returns, error conditions, or how it integrates with sibling tools, making it inadequate for safe and effective use by an agent.

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 1 parameter with 0% description coverage, and the tool description adds no information about parameters. Since there's only one optional parameter ('gdb_path'), the baseline is 4, but the description doesn't compensate for the lack of schema details (e.g., explaining what 'gdb_path' is for or its default behavior), so it's scored lower at 3.

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 action ('Start') and the resource ('a new GDB debugging session'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'debugger_start' or 'lldb_start', which appear to serve similar functions for different debuggers, leaving some ambiguity about when to choose this specific tool.

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. With siblings like 'debugger_start' and 'lldb_start' available, it's unclear whether this tool is for GDB specifically, when it should be preferred over generic debugger tools, or what prerequisites might be needed (e.g., an existing process to debug).

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/smadi0x86/MDB-MCP'

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