Skip to main content
Glama

get_symbol_definition

Read-onlyIdempotent

Finds where a function, class, or method is actually defined in this repo -- exact file, line range, and signature-relevant metadata (async, decorators, docstring if present). Use this before assuming a symbol's location/signature from memory or from a similarly-named symbol in a different file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe bare symbol name (e.g. "get_upstream_impact"), or "ClassName.method_name" for a specific method when the bare name is ambiguous across multiple classes.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so the safety profile is known. The description adds value by disclosing the return content (exact file, line range, signature-relevant metadata like async, decorators, docstring) and the ambiguity handling (bare name vs. qualified method name). No contradictions with 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?

The description is exactly two sentences, front-loaded with the core purpose and output, followed by a useful usage tip. Every sentence earns its place with no redundancy or extraneous detail.

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?

This is a simple read-only lookup tool with a single well-documented parameter and an output schema (as indicated by context). The description covers what it does, what it returns, and when to use it. The behavior is fully contextualized for the agent without unnecessary detail.

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

Parameters3/5

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

The input schema description for 'name' fully explains the bare symbol and qualified method name formats, covering 100% of the parameter semantics. The tool description does not add additional parameter details beyond this, so the baseline of 3 applies.

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's purpose with a specific verb ('Finds') and resource ('where a function, class, or method is actually defined') and specifies the exact output type (file, line range, metadata). It differentiates from siblings like search_code (which finds occurrences) and get_callers/callees (which find relationships) by focusing on the definition site.

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 explicit usage context: 'Use this before assuming a symbol's location/signature from memory or from a similarly-named symbol in a different file.' This gives clear when-to-use guidance, though it does not explicitly name alternative tools or state when not to use it. Since sibling tools are reasonably self-evident, this is clear context without exclusions.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.4/5.0
Disambiguation5/5

Each tool targets a distinct aspect of code understanding: callees (outgoing calls), callers (incoming calls), dependencies (imports), symbol definitions (location/signature), and open-ended search. There is no overlap between them; search_code is explicitly positioned as the fallback for when exact symbols aren't known.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern: get_callees, get_callers, get_dependencies, get_symbol_definition, search_code. 'search_code' uses 'search' as the verb, matching the same structure. No camelCase or mixed conventions.

Tool Count5/5

Five tools is a well-scoped set for a code-intelligence server. Each tool covers a necessary query type without redundancy, and the count avoids the confusion of a large surface while being substantial enough to handle common codebase exploration tasks.

Completeness4/5

The set covers the main code navigation needs: caller/callee graphs, file dependencies, symbol definitions, and free-text search. Minor gaps exist, such as lacking direct file-content retrieval or type hierarchy queries, but these are often handled by search_code or are out of scope for a 'brain' server focused on relationships and definitions.