Skip to main content
Glama

gdb_pwndbg

Run pwndbg, gef, or peda helper commands within GDB to debug crashes, inspect ELF binaries, and solve CTF Pwn challenges.

Instructions

Execute pwndbg/gef/peda helper commands if they appear available.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYes
confirmNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • server.py:1408-1408 (registration)
    MCP tool registration decorator for gdb_pwndbg
    @mcp.tool()
  • Full handler function for the gdb_pwndbg tool. Executes pwndbg/gef/peda helper commands with availability checks, risk assessment, and confirmation gating.
    @mcp.tool()
    def gdb_pwndbg(command: str, confirm: bool = False) -> dict[str, Any]:
        """Execute pwndbg/gef/peda helper commands if they appear available."""
    
        if not ENABLE_PWNDBG_COMMANDS:
            return make_result(ok=False, tool="gdb_pwndbg", action="plugin", error="pwndbg commands are disabled")
        try:
            assessment = assess_gdb_command(command)
            gated = _risk_gate(tool="gdb_pwndbg", action="plugin", command=command, assessment=assessment, confirm=confirm)
            if gated:
                return gated
            availability_checks = {
                "pwndbg": _exec_cli_internal("help pwndbg", parse=False).ok,
                "gef": "GEF" in _exec_cli_internal("gef config", parse=False).stdout,
                "peda": _exec_cli_internal("help peda", parse=False).ok,
            }
            if not any(availability_checks.values()):
                return make_result(
                    ok=False,
                    tool="gdb_pwndbg",
                    action="plugin",
                    data={"available": False, "checks": availability_checks},
                    error="pwndbg/gef/peda does not appear to be loaded in this GDB session",
                )
            res = _exec_cli_internal(command, timeout=DEFAULT_TIMEOUT, parse=True)
            return _command_result_to_tool_result(
                tool="gdb_pwndbg",
                action="plugin",
                command=command,
                result=res,
                assessment=assessment,
                confirmed=confirm,
            )
        except Exception as exc:
            return make_result(ok=False, tool="gdb_pwndbg", action="plugin", error=str(exc))
  • Function signature/parameters for gdb_pwndbg: command (str) and confirm (bool, default False)
    def gdb_pwndbg(command: str, confirm: bool = False) -> dict[str, Any]:
  • Configuration flag ENABLE_PWNDBG_COMMANDS controlling whether pwndbg tools are enabled
    ENABLE_PWNDBG_COMMANDS = _env_bool("GDB_MCP_ENABLE_PWNDBG_COMMANDS", True)
Behavior2/5

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

No annotations exist, so description must cover behavioral traits. It only mentions executing commands 'if they appear available', with no details on side effects, errors, or permissions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence is concise but lacks structure and essential detail. Under-specification does not earn 'conciseness' credit.

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?

With many sibling GDB tools and an output schema, the description fails to explain when pwndbg commands are appropriate or what the output contains. Incomplete for decision-making.

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

Parameters1/5

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

Schema coverage is 0% and description provides no information about the 'command' or 'confirm' parameters. Agent has no guidance on valid commands or usage of confirm flag.

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?

Description specifies verb 'Execute' and resource 'pwndbg/gef/peda helper commands', which clearly identifies the tool's domain. However, 'if they appear available' adds uncertainty, and it doesn't differentiate from sibling tools like gdb_analyze.

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 on when to use this tool vs alternatives. Does not specify prerequisites or context for executing helper commands.

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/traver88/gdb-mcp'

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