Skip to main content
Glama

gdb_evaluate_expression

Evaluate C/C++ expressions within an active GDB debugging session. Access variables, dereference pointers, and call functions to obtain the expression value and inspect program state.

Instructions

Evaluate a C/C++ expression in the current context and return its value. Can access variables, dereference pointers, call functions, etc. Requires session_id parameter (obtained from gdb_start_session).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYesSession ID from gdb_start_session
expressionYesC/C++ expression to evaluate
Behavior2/5

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

No annotations exist, so the description must fully disclose behavior. It states the tool can call functions but does not mention potential side effects of such calls. It also fails to specify error handling or the format of the returned value, leaving important behaviors undisclosed.

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 two sentences long, starts with the core purpose, and adds necessary context without redundancy. Every sentence is informative and efficient.

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?

Given the lack of an output schema, the description should explain the return value format. It only says 'return its value', which is vague. For a tool that evaluates expressions, more detail on the result type (e.g., string representation) is needed. However, the tool is simple and the description covers the input well.

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?

Schema coverage is 100% with descriptions, but the description adds context by specifying that session_id comes from gdb_start_session and by listing capabilities (dereference, call functions) that go beyond the schema parameter descriptions.

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 the tool evaluates a C/C++ expression and returns its value, with specific examples like accessing variables and dereferencing pointers. This distinguishes it from siblings like gdb_call_function which is more specialized.

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 mentions the required session_id parameter from gdb_start_session, implying the tool is used only after starting a session. However, it does not explicitly address when not to use it or compare with alternatives like gdb_call_function, though the context is relatively clear.

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