Skip to main content
Glama

lldb_symbols

Read-onlyIdempotent

Look up symbols like functions, variables, and types in an executable using name, regex, address, or type searches to debug C/C++ programs.

Instructions

Look up symbols (functions, variables, types) in an executable.

Search types:
- 'name': Exact symbol name lookup
- 'regex': Regular expression pattern matching
- 'address': Find symbol at a specific address
- 'type': Look up a type definition

Args:
    params: SymbolLookupInput with query and search type

Returns:
    str: Symbol information including address and source location

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main handler function that executes LLDB image lookup commands based on the query type to find symbols in the executable.
    async def lldb_symbols(params: SymbolLookupInput) -> str:
        """Look up symbols (functions, variables, types) in an executable.
    
        Search types:
        - 'name': Exact symbol name lookup
        - 'regex': Regular expression pattern matching
        - 'address': Find symbol at a specific address
        - 'type': Look up a type definition
    
        Args:
            params: SymbolLookupInput with query and search type
    
        Returns:
            str: Symbol information including address and source location
        """
        commands = [f"target create {params.executable}"]
    
        if params.query_type == "name":
            commands.append(f"image lookup --name {params.query}")
        elif params.query_type == "regex":
            commands.append(f"image lookup --regex --name {params.query}")
        elif params.query_type == "address":
            commands.append(f"image lookup --address {params.query}")
        elif params.query_type == "type":
            commands.append(f"image lookup --type {params.query}")
        else:
            commands.append(f"image lookup --name {params.query}")
    
        result = _run_lldb_script(commands)
    
        return f"## Symbol Lookup: `{params.query}`\n\n```\n{result['output'].strip()}\n```"
  • MCP tool registration decorator that registers the lldb_symbols handler with the FastMCP server.
    @mcp.tool(
        name="lldb_symbols",
        annotations={
            "title": "Lookup Symbols",
            "readOnlyHint": True,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": False,
        },
    )
  • Pydantic input schema defining parameters for the lldb_symbols tool: executable path, query string, and query type.
    class SymbolLookupInput(BaseModel):
        """Input for looking up symbols."""
    
        model_config = ConfigDict(str_strip_whitespace=True)
    
        executable: str = Field(..., description="Path to the executable", min_length=1)
        query: str = Field(..., description="Symbol name or pattern to search for", min_length=1)
        query_type: str = Field(
            default="name",
            description="Type of lookup: 'name' (exact), 'regex' (pattern), 'address' (hex address), 'type' (type name)",
        )
Behavior4/5

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

Annotations already indicate readOnlyHint=true, destructiveHint=false, and idempotentHint=true, covering safety and idempotency. The description adds value by specifying the search types and return format ('Symbol information including address and source location'), which provides context beyond annotations. No contradictions with annotations exist.

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 main purpose, followed by a bulleted list of search types and clear sections for Args and Returns. Every sentence earns its place, with no wasted words, making it efficient and easy to scan.

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

Completeness5/5

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

Given the tool's moderate complexity, rich annotations (readOnlyHint, idempotentHint), and the presence of an output schema (implied by 'Returns: str'), the description is complete enough. It covers purpose, search types, input structure, and return format, providing sufficient context 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.

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 detailing the 'params' input structure and listing search types (name, regex, address, type). However, it does not fully explain the 'executable' or 'query' parameters beyond what the schema provides, leaving some semantic gaps. With 0% coverage, a baseline of 3 is appropriate as the description adds partial value.

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: 'Look up symbols (functions, variables, types) in an executable.' It specifies the verb ('look up'), resource ('symbols'), and scope ('in an executable'), and distinguishes it from sibling tools like lldb_disassemble or lldb_backtrace by focusing on symbol lookup rather than disassembly or stack traces.

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 by listing four search types (name, regex, address, type), which helps users understand when to use this tool for different lookup scenarios. However, it does not explicitly mention when not to use it or name alternatives among sibling tools, such as lldb_evaluate for expression evaluation.

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