Skip to main content
Glama

lldb_registers

Read-onlyIdempotent

View CPU register values at a breakpoint in C/C++ programs. Display general, floating point, or vector registers in hexadecimal format to debug low-level execution.

Instructions

View CPU register values at a breakpoint.

Register sets:
- 'general': General purpose registers (rax, rbx, rsp, etc.)
- 'float': Floating point registers
- 'vector': SIMD/vector registers (xmm, ymm)
- 'all': All register sets

Args:
    params: RegistersInput with breakpoint and register selection

Returns:
    str: Register values in hexadecimal format

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main handler function that executes LLDB commands to read CPU registers at a specified breakpoint and returns formatted output.
    async def lldb_registers(params: RegistersInput) -> str:
        """View CPU register values at a breakpoint.
    
        Register sets:
        - 'general': General purpose registers (rax, rbx, rsp, etc.)
        - 'float': Floating point registers
        - 'vector': SIMD/vector registers (xmm, ymm)
        - 'all': All register sets
    
        Args:
            params: RegistersInput with breakpoint and register selection
    
        Returns:
            str: Register values in hexadecimal format
        """
        commands = [
            f"target create {params.executable}",
            f"breakpoint set --name {params.breakpoint}",
            "run" + (" " + " ".join(params.args) if params.args else ""),
        ]
    
        if params.specific_registers:
            reg_cmd = f"register read {' '.join(params.specific_registers)}"
        elif params.register_set == "all":
            reg_cmd = "register read --all"
        elif params.register_set == "float":
            reg_cmd = "register read --set 1"  # Usually FPU
        elif params.register_set == "vector":
            reg_cmd = "register read --set 2"  # Usually SSE/AVX
        else:
            reg_cmd = "register read"
    
        commands.append(reg_cmd)
        commands.append("quit")
    
        result = _run_lldb_script(commands)
    
        return f"## Registers at `{params.breakpoint}`\n\n```\n{result['output'].strip()}\n```"
  • Pydantic input schema defining parameters for the lldb_registers tool, including executable path, breakpoint, register set, specific registers, and arguments.
    class RegistersInput(BaseModel):
        """Input for viewing registers."""
    
        model_config = ConfigDict(str_strip_whitespace=True)
    
        executable: str = Field(..., description="Path to the executable", min_length=1)
        breakpoint: str = Field(..., description="Breakpoint location to stop at", min_length=1)
        register_set: str = Field(
            default="general",
            description="Register set to display: 'general', 'float', 'vector', 'all'",
        )
        specific_registers: list[str] | None = Field(
            default=None, description="Specific register names to show (e.g., ['rax', 'rbx', 'rsp'])"
        )
        args: list[str] | None = Field(
            default=None, description="Command-line arguments to pass to the program"
        )
  • MCP tool registration decorator that registers the lldb_registers handler with the FastMCP server, including metadata annotations.
    @mcp.tool(
        name="lldb_registers",
        annotations={
            "title": "View Registers",
            "readOnlyHint": True,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": False,
        },
    )
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=false, covering safety and idempotency. The description adds valuable behavioral context by specifying that it works 'at a breakpoint' and describes the return format ('Register values in hexadecimal format'), which goes beyond what annotations provide.

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 well-structured and front-loaded with the core purpose, followed by register sets and parameter/return details. Every sentence earns its place without redundancy, making it efficient and easy to parse.

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

Completeness4/5

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

Given the tool's complexity (debugging with multiple parameters) and the presence of annotations and an output schema, the description is largely complete. It explains the purpose, register sets, and return format, though it could benefit from more detailed parameter guidance. The output schema reduces the need to fully describe returns.

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?

Schema description coverage is 0%, but the description compensates by listing the register set options and mentioning that params include 'breakpoint and register selection'. However, it doesn't fully detail all parameters (e.g., executable, args, specific_registers) beyond what's implied. With 0% schema coverage, the description adds some but not complete parameter semantics.

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

Purpose5/5

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

The description clearly states the tool's purpose with a specific verb ('View') and resource ('CPU register values at a breakpoint'), distinguishing it from siblings like lldb_examine_variables or lldb_read_memory. It explicitly mentions what register sets are available, making the scope unambiguous.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool (to view register values at a breakpoint), but it doesn't explicitly state when not to use it or name alternatives among siblings. The context is sufficient for typical debugging scenarios, though it lacks explicit 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/benpm/claude_lldb_mcp'

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