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.

  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.