Skip to main content
Glama

计算表达式

gdb_evaluate_expression
Read-onlyIdempotent

Compute and return the value of a GDB expression such as a variable, pointer dereference, or arithmetic operation for debugging embedded systems.

Instructions

计算并返回表达式的值。

参数:

  • expression: 要计算的表达式 (如 x, *ptr, sizeof(var), x+y)

示例:

  • gdb_evaluate_expression({expression: "x"}) → 返回变量x的值

  • gdb_evaluate_expression({expression: "*ptr"}) → 返回指针指向的值

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYesExpression to evaluate, e.g., x, *ptr, sizeof(var)
Behavior4/5

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

Annotations already convey read-only, non-destructive, idempotent behavior. The description adds value by specifying the return value and examples of expressions, which provides behavioral context beyond annotations.

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?

Two short paragraphs with examples. No wasted words, information is front-loaded.

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?

Despite no output schema, the description explains what is returned (the evaluated value) and provides examples, making it complete for a simple evaluation tool.

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 covers the parameter with a description; the description extends it with concrete examples of valid expressions, adding meaningful guidance beyond the schema.

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 computes and returns expression values. It distinguishes from siblings by focusing on arbitrary expression evaluation, unlike memory reads or register listings.

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?

Examples show typical usage scenarios (variables, pointers, sizeof). Implicitly it's for evaluating expressions during debugging; could explicitly mention alternatives like gdb_read_memory for addresses, but clear enough.

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/zjm1060/gdb-mcp'

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