Skip to main content
Glama

gdb_execute_command

Send a GDB command (CLI or MI) to an active debugging session. Handles multi-line commands and formats output for readability. Use for breakpoints, variable inspection, and thread analysis. Requires session ID from gdb_start_session.

Instructions

Execute a GDB command. Supports both CLI and MI commands. CLI commands (like 'info breakpoints', 'list', 'print x') are automatically handled and their output is formatted for readability. Multi-line commands (like 'commands', 'define', 'python') are supported; separate lines with \n. MI commands (starting with '-', like '-break-list', '-exec-run') return structured data. NOTE: For calling functions in the target process, prefer using the dedicated gdb_call_function tool instead of 'call' command, as it provides better structured output and can be separately permissioned. Common examples: 'info breakpoints', 'info threads', 'run', 'print variable', 'list main', 'disassemble func'. Requires session_id parameter (obtained from gdb_start_session).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYesSession ID from gdb_start_session
commandYesGDB command to execute
timeout_secNoSeconds to wait for this GDB command to complete
Behavior4/5

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

Discloses that CLI commands are auto-handled and formatted, multiline commands supported with , MI commands return structured data. Mentions timeout. No annotations provided, so description carries burden. Could mention potential side effects but adequate.

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

Conciseness4/5

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

Well-structured with front-loaded purpose, then details, then note about alternative. Slightly lengthy but each part adds value; could be more concise but effective.

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 3 parameters, no output schema, and many sibling tools, description is complete: purpose, usage guidelines, parameter details, examples, and alternative tool reference. Agent can correctly select and invoke.

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

Parameters5/5

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

Schema coverage 100%, description adds significant context: session_id source, command types, timeout default and purpose. Enhances understanding beyond schema with examples and CLI/MI differentiation.

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?

Clearly states the verb 'Execute' and resource 'GDB command'. Distinguishes from sibling tool gdb_call_function by noting preference for function calls. Provides examples of CLI and MI commands.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly explains when to use this tool (executing GDB commands) and when to use gdb_call_function instead. Mentions requirement of session_id from gdb_start_session. Provides common examples.

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/airfloats/gdb_mcp'

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