Skip to main content
Glama

find_code

Locate the method or class that answers a question about a codebase and return only that symbol with its code, avoiding whole-file reads.

Instructions

Find the method or class that answers a question about a codebase; returns only that symbol.

Output: "file:first-last Symbol" and its code, instead of whole files. Name the class or method if you know it ("PedidoJpaMapper aDominio"). AMBIGUOUS lists candidates in different files: refine the query or pass clue. The index resyncs by checksum, so code is never stale.

Args: query: What you are looking for: identifiers plus a few words. path: Project root directory (absolute). scope: "main" (skip tests, default), "test" or "all". subpath: Restrict to a directory inside the project. clue: Extra detail after an AMBIGUOUS reply. max_tokens: Cap on the returned code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clueNo
pathYes
queryYes
scopeNomain
subpathNo
max_tokensNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it discloses the return shape, the AMBIGUOUS state and how to respond, and that the index resyncs by checksum so code is never stale. It omits permission/error behavior, but the key behavioral traits of this search tool are covered.

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?

Purpose and output format are front-loaded, followed by an Args block that parses cleanly. It is slightly long, but each sentence adds operational value (output shape, ambiguity handling, param meanings) rather than filler.

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 six-parameter search tool with an output schema already covering return values, the description supplies everything an agent needs to call it correctly: scope defaults, subpath restriction, ambiguity recovery, and token capping.

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?

Schema description coverage is 0%, so the description must compensate fully and does: every one of the six parameters is explained, including scope's valid values ('main' default skipping tests, 'test', 'all'), subpath's containment, clue's role after an AMBIGUOUS reply, and max_tokens' cap.

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?

States a specific verb+resource (find the method or class answering a question) and its scope, and distinguishes itself from siblings by returning only the symbol 'instead of whole files', which implicitly separates it from read_file and project_map.

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?

Gives clear context: name the class/method when known, handle AMBIGUOUS by refining the query or passing `clue`. It does not explicitly name sibling alternatives or state when NOT to use it, so it stops short of a full when/when-not routing rule.

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