Skip to main content
Glama

Find a declaration (LayerMap)

project_search_map
Read-onlyIdempotent

Use this to find where a function, method, class or type is declared, by name or by words in its name, path or documentation, before exploring its callers with project_explore_map.

Instructions

Use this to find where a function, method, class or type is declared, by name or by words in its name, path or documentation, before exploring its callers with project_explore_map. Find declarations and files whose names, paths or source documentation match query terms. ANY (default) matches any term, ALL requires every term, LITERAL matches the exact text. Results are ranked by relevance and grouped by file with the declaration name, kind, 1-based line range and matched fields (kinds f function, c class, m method, p property, v variable, t type, i interface, e enum; numbers are 1-based source lines). Zoom into a result with project_explore_map({path,name}) or read its line range in the file. This is not a full-text search and does not prove absence; search the source text itself for exact text. Continue with offset and unchanged conditions.

Input Schema

NameRequiredDescriptionDefault
pathNo.
kindsNo
queryYes
offsetNo
matchModeNoANY matches one or more query terms; ALL requires every term; LITERAL matches the complete text literally.ANY
maxResultsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds substantial non-obvious behavior: results are relevance-ranked and grouped by file, include name/kind/1-based line range/matched fields, and the important caveat that absence is not proven. It also discloses the kind-code legend (f, c, m, p, v, t, i, e).

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?

Front-loads purpose and the sibling relationship, then layers matching rules, return shape, and caveats. It is a single dense paragraph where most sentences earn their place, though the kind-code enumeration makes it heavier than strictly necessary.

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?

With no output schema, the description compensates by describing the return shape (grouped by file, declaration name, kind, 1-based line range, matched fields) and pagination via offset. For a read-only search tool, an agent has everything needed to call and interpret it.

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 only 17%, so the description carries the burden and does so well: it explains matchMode (ANY default, ALL, LITERAL), the term-matching semantics of query, the meaning of kinds via letter codes, and offset-based pagination. maxResults and path semantics are left unstated, keeping it short of a 5.

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 and resource ('find where a function, method, class or type is declared') plus the matching dimensions (name, path, documentation). It explicitly distinguishes itself from the sibling project_explore_map by positioning that tool as the follow-up for callers.

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

Usage Guidelines5/5

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

Gives explicit when-to-use ('before exploring its callers with project_explore_map'), when-not ('This is not a full-text search and does not prove absence; search the source text itself for exact text'), and continuation guidance ('Continue with offset'). Alternatives and exclusions are both named.

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