Skip to main content
Glama

gdb_start_session

Start a GDB debugging session for executable, core dump, or custom commands. Detects missing debug symbols and other warnings, returning a session ID for further debugging tools.

Instructions

Start a new GDB debugging session. Can load an executable, core dump, or run custom initialization commands. Automatically detects and reports important warnings such as: missing debug symbols (not compiled with -g), file not found, or invalid executable. Check the 'warnings' field in the response for critical issues that may affect debugging. Available parameters: program (executable path), args (program arguments), core (core dump path - uses --core flag for proper symbol resolution), init_commands (GDB commands to run after loading), env (environment variables), gdb_path (GDB binary path), working_dir (directory to run program from). IMPORTANT for core dump debugging: Set 'sysroot' and 'solib-search-path' AFTER loading the core (either via 'core' parameter or 'core-file' init_command) for symbols to resolve correctly. Returns a session_id integer that must be passed to all other GDB tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
programNoPath to executable to debug
argsNoCommand-line arguments for the program
init_commandsNoGDB commands to run on startup (e.g., 'core-file /path/to/core', 'set sysroot /path')
envNoEnvironment variables to set for the debugged program (e.g., {'LD_LIBRARY_PATH': '/custom/libs'})
gdb_pathNoPath to GDB executable (default: from GDB_PATH env var or 'gdb')
working_dirNoWorking directory to use when starting GDB. Use this when debugging programs that need to be run from a specific directory, or when the program expects to find files (config, data, etc.) relative to its working directory. GDB will be started in this directory, then the original directory is restored. Example: If debugging a server that loads config from './config.json', set working_dir to the server's directory.
coreNoPath to core dump file for post-mortem debugging. When specified, GDB is started with --core flag which properly initializes symbol resolution. IMPORTANT: When using a sysroot with core dumps, set sysroot AFTER the core is loaded (either via this parameter or core-file command) for symbols to resolve correctly.
Behavior5/5

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

With no annotations provided, the description fully carries the burden. It discloses that warnings are reported in a 'warnings' field, that a session_id is returned and must be used with other tools, and explains the required sequence for core dump symbol resolution (sysroot after core load). This is comprehensive behavioral disclosure.

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?

The description is somewhat lengthy and mixes parameter listing with usage notes. It could be more structured, perhaps by separating parameter details from procedural notes. While every sentence adds value, the overall flow could be tighter. There is some redundancy with the schema descriptions.

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 the complexity of the tool (7 parameters, no output schema, important behavioral nuances), the description covers all necessary aspects: what the tool does, how to use parameters, key warnings, the returned session_id, and critical ordering for core dump debugging. It is complete and effectively supports an AI agent in correct invocation.

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 is 100%, but the description adds significant value beyond the schema. For example, it explains the --core flag for core dumps and the important ordering for symbol resolution, provides examples for init_commands and working_dir, and clarifies the use of env. This extra context is highly beneficial for correct usage.

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?

The description clearly states it starts a new GDB debugging session and lists the actions it can perform (load executable, core dump, init commands). It differentiates from sibling tools (e.g., gdb_set_breakpoint, gdb_continue) by focusing on session initialization. The purpose is specific and unambiguous.

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

Usage Guidelines4/5

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

The description provides clear guidance on when to use the tool (starting a session) and gives important usage notes, especially for core dump debugging with sysroot. It does not explicitly state when not to use or list alternatives, but the context of sibling tools and the session-oriented nature mitigates this. The warnings about critical issues in the response add value.

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