Skip to main content
Glama
sbergeron42

gdb-multiarch-mcp

by sbergeron42

switch_localize

Convert absolute addresses or register values to offsets relative to the main executable's base address for debugging Nintendo Switch applications in GDB.

Instructions

Convert an absolute address or register value to an offset relative to the base of main. Example: address '$x0' or '0x8012345'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesAbsolute address or register name (e.g. '0x8012345' or '$x0')

Implementation Reference

  • The handler for 'switch_localize' in the 'call_tool' function, which extracts the address from arguments and executes a 'localize' command on the GDB session.
    elif name == "switch_localize":
        a = LocalizeArgs(**arguments)
        result = session.execute_command(f"localize {a.address}")
  • Input schema definition for the 'switch_localize' tool.
    class LocalizeArgs(BaseModel):
        address: str = Field(
            ...,
            description="Absolute address or register name (e.g. '0x8012345' or '$x0')",
  • Registration of the 'switch_localize' tool in the MCP server setup.
    Tool(
        name="switch_localize",
        description=(
            "Convert an absolute address or register value to an offset relative "
            "to the base of main. Example: address '$x0' or '0x8012345'."
        ),
        inputSchema=LocalizeArgs.model_json_schema(),
    ),
Behavior3/5

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

With no annotations provided, the description must carry the full burden of behavioral disclosure. It successfully explains the conversion logic (absolute to relative offset), but fails to specify whether this is a read-only calculation or modifies debugger state, what format the return value takes, or how errors are handled for invalid addresses.

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, information-dense sentence that front-loads the core functionality. Every clause earns its place: the transformation verb, the relative target, and the concrete examples. No redundant or filler text is present.

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

Completeness3/5

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

Given the tool's single-parameter simplicity and lack of output schema, the description adequately explains the input expectations. However, it omits the return value format (string offset? integer?) and does not explain what 'base of main' refers to (e.g., the main function entry point), which would be valuable contextual information for 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 100% description coverage, establishing a baseline of 3. The description reinforces the parameter semantics by repeating the example formats found in the schema ('$x0', '0x8012345'), but does not add significant new semantic information such as supported register name formats or address validation rules beyond the schema.

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 core operation using specific verbs ('Convert') and identifies the resource ('absolute address or register value') and target ('offset relative to the base of main'). However, it does not explicitly differentiate from sibling tools like 'gdb_evaluate_expression' that might also handle address calculations.

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?

While the description provides input format examples ('$x0' or '0x8012345'), it offers no guidance on when to use this tool versus alternatives such as 'switch_get_pc' or 'gdb_evaluate_expression'. There are no stated prerequisites, exclusions, or workflow context.

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

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