Skip to main content
Glama

find_definition

Find where a symbol is defined in your codebase, retrieving its file path, line number, and surrounding context.

Instructions

šŸŽÆ Find the definition location of a symbol (function, class, variable, method).

šŸŽÆ PURPOSE: Locates where a symbol is originally defined, providing file path, line number, and context. šŸ”§ USAGE: Use after analyze_codebase when you need to understand where a specific symbol is implemented. ⚔ PERFORMANCE: Fast operation (sub-second) - leverages cached code graph for instant lookups. šŸ”„ WORKFLOW: analyze_codebase → find_definition → examine definition context → find_references/find_callers for usage patterns. šŸ’” TIP: Works with partial names - 'MyClass' will find 'MyClass', 'MyClassImpl', etc. Use exact names for precision.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesSymbol name to find definition for (supports partial matching)
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It adds valuable behavior details: performance (sub-second), reliance on a cached code graph, and partial-name matching with an example ('MyClass' will find 'MyClassImpl'). It does not cover error cases or return format, but for a simple read-only lookup the disclosed behaviors are useful and non-obvious.

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?

The description is well-structured with labeled sections (PURPOSE, USAGE, PERFORMANCE, WORKFLOW, TIP) and front-loaded with the core purpose. It is slightly verbose due to emojis and some redundancy between the first line and the PURPOSE section, but every section adds useful context. Not perfectly concise, but effective.

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?

For a single-parameter tool with no output schema and no annotations, the description is remarkably complete. It covers the tool's purpose, usage context, performance, matching behavior, and workflow integration. All key aspects an agent needs to select and invoke the tool are present, making it a fully self-contained description.

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%, so baseline is 3. The description adds extra meaning to the 'symbol' parameter by explaining partial matching and advising 'Use exact names for precision.' This goes beyond the schema's simple 'supports partial matching' and gives the agent a clearer understanding of the parameter's behavior.

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 function: locating the definition of a symbol (function, class, variable, method). It uses specific verbs like 'find' and 'locates', and explicitly mentions the resource (symbol definitions). It distinguishes itself from sibling tools like find_references and find_callers by focusing on the original definition location rather than usage patterns.

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 clear usage context: 'Use after analyze_codebase when you need to understand where a specific symbol is implemented.' It also outlines a workflow (analyze_codebase → find_definition → examine context → find_references/find_callers) and mentions what the tool is not for ('find_references/find_callers for usage patterns'). It lacks explicit 'when not to use' statements but the workflow and alternative mentions implicitly guide the agent.

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/entrepeneur4lyf/code-graph-mcp'

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