Skip to main content
Glama

get_definition

Retrieves a C/C++ symbol's definition location as file and line number plus entity details, enabling precise code navigation and symbol lookup.

Instructions

获取符号的定义位置(文件:行号)及实体信息。

Input Schema

NameRequiredDescriptionDefault
nameYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.8/5.0
Behavior2/5

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

No annotations exist, so the description carries the full burden; it mentions the returned location and entity info but says nothing about behavior when the symbol is unresolved, whether multiple definitions/overloads are returned, whether an index or workspace must be loaded, or the cost of the call. An output schema covers the returned fields, but the operational edge cases remain undisclosed.

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?

A single short sentence with the resource and return payload front-loaded, no filler. It is efficient, though the terseness contributes to the missing guidance rather than compensating for it.

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?

The tool is simple (one required param, output schema present), so the description covers the essentials of what comes back. It is still incomplete on the inputs an agent must supply and on unresolved-symbol behavior, which matter for a lookup that can legitimately fail.

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

Parameters2/5

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

Schema description coverage is 0% and the single required parameter 'name' has no documented meaning. The description only obliquely implies it is a symbol name via '符号', leaving format (fully-qualified vs simple), case sensitivity, and namespace/module qualification unaddressed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('获取符号的定义位置') and even the return shape (文件:行号 plus entity info), so an agent knows exactly what it produces. It does not name or contrast any sibling such as search_entities or get_ast, so differentiation is left to inference.

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?

There is no explicit when-to-use, when-not-to-use, or alternative routing. The presence of search_entities, get_ast and list_entities among siblings means an agent must guess that this is for resolving an already-known symbol name, which is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.