Skip to main content
Glama

debugger_command

Execute custom debugger commands in GDB to control program execution, examine memory, analyze stacks, or perform disassembly during debugging sessions.

Instructions

Execute an arbitrary debugger command.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes
commandYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:72-77 (handler)
    The main handler function for the 'debugger_command' MCP tool. It takes session_id and command as string parameters, validates that debugger_tools is available, and delegates execution to debugger_tools.execute_command(). The @mcp.tool() decorator on line 72 registers this as an MCP tool.
    @mcp.tool()
    def debugger_command(session_id: str, command: str) -> str:
        """Execute an arbitrary debugger command."""
        if not debugger_tools:
            return "Error: No debuggers are available on this system"
        return debugger_tools.execute_command(session_id, command)
  • The GDB-specific implementation of execute_command. It retrieves the GDB session by ID, sends the command to GDB via gdb.write(), formats the response, and handles broken pipe errors by cleaning up dead sessions.
    @handle_gdb_errors("executing command")
    def execute_command(self, session_id: str, command: str) -> str:
        gdb = self.sessionManager.get_session(session_id)
        try:
            response = gdb.write(command)
            return format_gdb_response(response)
        except BrokenPipeError:
            self.sessionManager._cleanup_dead_session(session_id)
            raise BrokenPipeError("GDB session connection lost")
  • The LLDB-specific implementation of execute_command. It retrieves the LLDB debugger session, uses the command interpreter to handle the command, and returns formatted output or error messages.
    @handle_lldb_errors("executing command")
    def execute_command(self, session_id: str, command: str) -> str:
        debugger = self.session_manager.get_session(session_id)
        
        interpreter = debugger.GetCommandInterpreter()
        result = lldb.SBCommandReturnObject()
        
        interpreter.HandleCommand(command, result)
        
        if result.Succeeded():
            output = result.GetOutput() or result.GetError() or "Command executed"
            return format_lldb_response(output)
        else:
            error_msg = result.GetError() or "Command failed"
            return f"Error: {error_msg}"
  • Abstract method definition for execute_command in the base DebuggerTools class. Defines the interface contract that all debugger implementations must follow: takes session_id and command as string parameters and returns a string result.
    def execute_command(self, session_id: str, command: str) -> str:
        """Execute an arbitrary debugger command."""
        pass
  • server.py:72-72 (registration)
    The @mcp.tool() decorator registers the debugger_command function as an MCP tool. FastMCP uses the function signature (session_id: str, command: str) -> str as the schema definition for the tool's input/output validation.
    @mcp.tool()
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 mentions 'Execute' which implies a write/mutation operation, but doesn't specify if this requires an active debugger session, what permissions are needed, potential side effects (e.g., altering program state), or error handling. The description is minimal and lacks critical behavioral context for a tool that likely interacts with debugging systems.

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 with no wasted words. It's appropriately sized and front-loaded, directly stating the tool's action without unnecessary elaboration, 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 a debugger command tool (likely involving session management and command execution), the description is incomplete. No annotations exist, and while an output schema is present (which might help with return values), the description doesn't cover essential context like session requirements, command syntax, or behavioral traits. This leaves significant gaps for an AI agent to use the tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning the schema provides no descriptions for the two parameters (session_id and command). The description adds no meaning beyond the parameter names—it doesn't explain what a 'session_id' refers to (e.g., an active debug session) or what format 'command' should be in (e.g., debugger-specific syntax). This fails to compensate for the low schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Execute an arbitrary debugger command' states a verb ('Execute') and resource ('debugger command'), but it's vague about what constitutes a 'debugger command' and doesn't distinguish this tool from sibling tools like gdb_command or lldb_command. It's slightly better than a tautology but lacks specificity about which debugger context it operates in.

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?

No guidance is provided on when to use this tool versus alternatives like gdb_command or lldb_command, or when to use it relative to other debugger_* tools (e.g., after starting a session). The description implies usage for executing commands but offers no context about prerequisites or exclusions.

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