Skip to main content
Glama
sbergeron42

gdb-multiarch-mcp

by sbergeron42

gdb_select_thread

Select a specific thread in gdb-multiarch debugging to focus on its execution and state during Nintendo Switch debugging sessions.

Instructions

Select a specific thread.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thread_idYesThread ID to select

Implementation Reference

  • The handler implementation for the `gdb_select_thread` tool, which calls `execute_command` with `-thread-select` using the GDB/MI protocol.
    def select_thread(self, thread_id: int) -> dict[str, Any]:
        """
        Select a specific thread to make it the current thread.
    
        Args:
            thread_id: Thread ID to select
    
        Returns:
            Dict with status and selected thread information
        """
        result = self.execute_command(f"-thread-select {thread_id}")
    
        if result["status"] == "error":
            return result
    
        mi_result = self._extract_mi_result(result) or {}
    
        return {
            "status": "success",
            "thread_id": thread_id,
            "new_thread_id": mi_result.get("new-thread-id"),
            "frame": mi_result.get("frame"),
        }
  • Tool registration for `gdb_select_thread` in `src/gdb_multiarch_mcp/server.py`.
    Tool(
        name="gdb_select_thread",
        description="Select a specific thread.",
        inputSchema=ThreadSelectArgs.model_json_schema(),
    ),
  • The execution path in the server loop that calls `session.select_thread`.
    elif name == "gdb_select_thread":
        a = ThreadSelectArgs(**arguments)
        result = session.select_thread(thread_id=a.thread_id)
Behavior2/5

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

No annotations are provided, so the description carries full burden of disclosure. Fails to explain that this changes debugger state (current thread context), whether the change persists across continues, or error conditions (invalid thread ID). 'Select' implies mutation but lacks safety/scope details.

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

Conciseness3/5

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

Extremely terse (four words), but brevity here results in under-specification rather than efficient communication. While no sentences are wasted, the single sentence fails to earn its place by lacking actionable context for an AI agent.

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?

Inadequate for a state-changing debugging operation. Lacks explanation of side effects (subsequent commands target this thread), interaction with gdb_select_frame, and return behavior. Given zero annotations and no output schema, the description should compensate with richer behavioral context.

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?

Input schema has 100% description coverage ('Thread ID to select'). The description adds no additional semantics about the thread ID format (GDB's internal numbering vs system TIDs) or how to obtain valid IDs, meeting the baseline for high schema coverage.

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

Purpose3/5

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

States the basic action (select) and target (thread) but remains vague about what selection means in a GDB context. Does not distinguish from sibling tool gdb_get_threads, which likely lists threads rather than setting the active thread context.

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?

Provides no guidance on when to use this tool versus alternatives, nor prerequisites (e.g., whether the program must be stopped). Missing context about how thread selection affects subsequent operations like gdb_get_backtrace or gdb_evaluate_expression.

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