Skip to main content
Glama

find_symbol

Search directories or files for classes, functions, methods, or variables by name. Recursively finds matching symbols to locate definitions quickly.

Instructions

Recursively search a directory or file for classes, functions, methods, or variables matching the target symbol name.

:param target_dir: Directory path or file path to search. :param symbol_name: Name or partial name of the symbol to search for.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
target_dirYes
symbol_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the burden of explaining behavior. It conveys recursive traversal, accepts both file and directory paths, performs partial-name matching, and searches for four symbol categories. This meaningfully reveals behavior beyond the schema, though it does not explicitly mention side-effect safety or whether hidden files/symlinks are included.

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 compact and front-loaded, with the core behavioral sentence appearing first. The parameter documentation adds value without redundancy, and every sentence contributes to understanding the tool's action or invocation parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is sufficient for a relatively simple two-parameter search tool, especially since an output schema is provided and return-value details need not be repeated. It lacks explicit alternative tool references, but given the output schema and simple parameter model, the description is largely complete for selection and invocation.

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

Parameters5/5

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

The input schema offers only parameter titles with 0% description coverage, so the description fully compensates. It clarifies that target_dir may be either a directory or file path, and that symbol_name can be a full name or partial fragment, giving the agent the exact operational meaning needed to invoke the tool correctly.

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 a specific action ('Recursively search') applied to a distinct resource ('directory or file') with a defined target ('classes, functions, methods, or variables'). It also identifies a key matching behavior (name or partial name), which sets it apart from sibling tools like find_class_methods or analyze_file_ast.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies its use for finding symbols recursively across a directory or file, but it never explicitly states when to choose it over alternatives or when not to use it. The sibling tools are not mentioned, so the agent must infer the difference from the name alone.

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/m-sameerkhan/code-ast-mcp'

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