Skip to main content
Glama
sbergeron42

gdb-multiarch-mcp

by sbergeron42

gdb_get_threads

Retrieve thread information for debugging Nintendo Switch executables in gdb-multiarch to analyze program execution and identify issues.

Instructions

Get information about all threads.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `GDBSession.get_threads` method implementation, which executes the GDB/MI `-thread-info` command and processes the result.
    def get_threads(self) -> dict[str, Any]:
        """
        Get information about all threads in the debugged process.
    
        Returns:
            Dict with thread information
        """
        logger.debug("get_threads() called")
        result = self.execute_command("-thread-info")
        logger.debug(f"get_threads: execute_command returned: {result}")
    
        if result["status"] == "error":
            logger.debug(f"get_threads: returning error from execute_command")
            return result
    
        # Extract thread data from result
        # Use helper method but keep robust error handling for None cases
        thread_info = self._extract_mi_result(result)
        logger.debug(f"get_threads: thread_info type={type(thread_info)}, value={thread_info}")
    
        if thread_info is None:
            logger.warning("get_threads: thread_info is None - GDB returned incomplete data")
            return {
                "status": "error",
                "message": "GDB returned incomplete data - may still be loading symbols",
            }
    
        # Ensure thread_info is a dict (helper returns None if extraction fails)
        if not isinstance(thread_info, dict):
            thread_info = {}
        threads = thread_info.get("threads", [])
        current_thread = thread_info.get("current-thread-id")
        logger.debug(
            f"get_threads: found {len(threads)} threads, current_thread_id={current_thread}"
        )
        logger.debug(f"get_threads: threads data: {threads}")
    
        return {
            "status": "success",
            "threads": threads,
            "current_thread_id": current_thread,
            "count": len(threads),
        }
  • The `call_tool` handler in `server.py` dispatches the `gdb_get_threads` tool call to `session.get_threads()`.
    elif name == "gdb_get_threads":
        result = session.get_threads()
  • The `gdb_get_threads` tool registration in the `list_tools` function.
    Tool(
        name="gdb_get_threads",
        description="Get information about all threads.",
        inputSchema=NO_ARGS_SCHEMA,
    ),
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It fails to specify what thread information is returned (IDs, names, states), whether the operation is read-only/safe, or if the target must be paused. It does not describe the output format despite lacking an output schema.

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 extremely brief at six words with zero redundancy. It is front-loaded and efficient, though minimalism comes at the cost of completeness for a tool with rich sibling context.

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?

For a debugging tool with no output schema, the description is minimally viable but incomplete. It omits what thread attributes are returned (e.g., thread IDs, current thread marker, stack pointers) and lacks context about GDB session requirements that would aid an agent in successful invocation.

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

Parameters4/5

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

The tool has zero parameters, establishing a baseline score of 4. With no inputs to document and 100% schema coverage (vacuously), the description appropriately requires no additional parameter clarification.

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 uses a clear verb ('Get') and resource ('threads'), specifying the scope covers 'all' threads. However, it lacks explicit differentiation from siblings like gdb_select_thread (which manipulates thread selection state) or gdb_get_status (which may include thread state).

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?

The description provides no guidance on when to use this tool versus alternatives like gdb_select_thread or gdb_get_backtrace. It does not mention prerequisites such as requiring an active debugging session or stopped inferior.

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