Skip to main content
Glama
signal-slot

MCP GDB Server

by signal-slot

gdb_step

Step through program execution in a GDB debugging session by specifying instructions or source lines, enabling precise control over debugging processes.

Instructions

Step program execution

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instructionsNoStep by instructions instead of source lines (optional)
sessionIdYesGDB session ID

Implementation Reference

  • The main execution logic for the gdb_step tool. Extracts sessionId and optional instructions flag from arguments, validates session exists, executes 'step' or 'stepi' GDB command via executeGdbCommand helper, and returns the output or error.
    private async handleGdbStep(args: any) {
      const { sessionId, instructions = false } = args;
      
      if (!activeSessions.has(sessionId)) {
        return {
          content: [
            {
              type: 'text',
              text: `No active GDB session with ID: ${sessionId}`
            }
          ],
          isError: true
        };
      }
      
      const session = activeSessions.get(sessionId)!;
      
      try {
        // Use stepi for instruction-level stepping, otherwise step
        const command = instructions ? "stepi" : "step";
        const output = await this.executeGdbCommand(session, command);
        
        return {
          content: [
            {
              type: 'text',
              text: `Stepped ${instructions ? 'instruction' : 'line'}\n\nOutput:\n${output}`
            }
          ]
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        return {
          content: [
            {
              type: 'text',
              text: `Failed to step: ${errorMessage}`
            }
          ],
          isError: true
        };
      }
    }
  • Input schema validation for gdb_step tool parameters: requires sessionId (string), optional instructions (boolean).
    inputSchema: {
      type: 'object',
      properties: {
        sessionId: {
          type: 'string',
          description: 'GDB session ID'
        },
        instructions: {
          type: 'boolean',
          description: 'Step by instructions instead of source lines (optional)'
        }
      },
      required: ['sessionId']
  • src/index.ts:219-235 (registration)
    Registration of gdb_step tool in the ListToolsRequestSchema response, including name, description, and input schema.
    {
      name: 'gdb_step',
      description: 'Step program execution',
      inputSchema: {
        type: 'object',
        properties: {
          sessionId: {
            type: 'string',
            description: 'GDB session ID'
          },
          instructions: {
            type: 'boolean',
            description: 'Step by instructions instead of source lines (optional)'
          }
        },
        required: ['sessionId']
      }
  • src/index.ts:377-378 (registration)
    Routing registration in CallToolRequestSchema handler switch statement that maps 'gdb_step' calls to the handleGdbStep method.
    case 'gdb_step':
      return await this.handleGdbStep(request.params.arguments);
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. 'Step program execution' implies a mutation (changing execution state) but doesn't specify effects like whether it steps into functions, handles breakpoints, or requires a paused session. It lacks details on permissions, side effects, or response format, leaving significant gaps for a debugging tool.

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 concise with 'Step program execution'—a single, front-loaded phrase that directly states the action. There's no wasted verbiage, making it efficient and easy to parse, though this brevity contributes to gaps in other dimensions.

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?

Given the complexity of debugging tools, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'step' entails, how it differs from siblings, what the output might be, or any behavioral traits, leaving the agent with insufficient context to use it 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 100%, with clear documentation for both parameters: 'sessionId' (required GDB session ID) and 'instructions' (optional boolean to step by instructions). The description adds no parameter semantics beyond the schema, so it meets the baseline of 3 without compensating or adding value.

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?

The description 'Step program execution' states a clear verb ('step') and resource ('program execution'), but it's vague about what 'step' means in this debugging context. It doesn't distinguish from siblings like 'gdb_next' (which likely steps over functions) or 'gdb_continue' (which resumes full execution), leaving ambiguity about its specific behavior.

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. With siblings like 'gdb_next', 'gdb_continue', and 'gdb_finish' that are related to execution control, there's no indication of context, prerequisites, or exclusions for 'gdb_step', making it unclear when an agent should select it.

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

Related 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/signal-slot/mcp-gdb'

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