Skip to main content
Glama

search

Read-onlyIdempotent

Find code by meaning across a repository using semantic and keyword matching, with modes for files, identifiers, or both.

Instructions

Search the codebase by MEANING. Modes: 'file' searches file headers/symbols, 'identifier' searches function/class definitions with call chains, 'hybrid' (default) runs both and returns combined results. Uses embeddings for semantic matching plus keyword overlap scoring. For an exact known symbol name in a language with a real language server available (e.g. via an LSP-backed MCP like Serena), prefer that for go-to-definition — this tool is best for meaning-based / fuzzy discovery across the whole repo.

Input Schema

NameRequiredDescriptionDefault
modeNoSearch mode: 'file' for files, 'identifier' for functions/classes, 'hybrid' for both. Default: hybrid.
rootNoAbsolute project root. Required with linked worktrees; subagents must pass their own worktree root on every call.
queryYesNatural language description of what you're looking for.
top_kNoNumber of matches to return. Default: 5.
formatNotext (default), compact JSON for agents, or verbose json for diagnostics.
fusionNoHow to combine semantic + keyword scores in file mode. 'rrf' (default) fuses rank positions and is robust when signal scales differ. 'weighted' is an opt-out that blends by semantic_weight/keyword_weight.
presetNoRanking preset. fast favors cheap lexical recall, balanced is default, exhaustive returns a wider set, semantic_only ignores keyword overlap (pure embedding similarity), keyword_only ignores embedding similarity (pure lexical match).
profileNoInclude phase timings in JSON/compact output for diagnosis.
inline_codeNoInline source with file matches. 'crux' (default) returns an ~8-line relevant span, 'full' returns the matched definition body, and 'off' returns pointers only.
include_kindsNoFilter identifier kinds, e.g. ["function", "method"]. Only for identifier/hybrid mode.
keyword_weightNoWeight for keyword overlap. Default: 0.28.
semantic_weightNoWeight for embedding similarity. Default: 0.72.
min_keyword_scoreNoMinimum keyword score filter. Accepts 0-1 or 0-100.
min_combined_scoreNoMinimum final score filter. Accepts 0-1 or 0-100.
min_semantic_scoreNoMinimum semantic score filter. Accepts 0-1 or 0-100.
include_dependenciesNoAdd up to three import pointers from the top two file matches to check supporting code.
require_keyword_matchNoWhen true, only return results with keyword overlap.
require_semantic_matchNoWhen true, only return results with positive semantic similarity.
top_calls_per_identifierNoHow many ranked call sites per identifier (identifier/hybrid mode). Default: 10.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.4.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, so the safety profile is free. The description adds real behavioral context: the hybrid scoring architecture (embeddings + keyword overlap) and the cost/coverage tradeoff implied by fast vs exhaustive presets. It doesn't discuss latency or cost per call explicitly, but it goes beyond annotation restatement.

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?

Four sentences, no filler, and the core purpose plus the mode taxonomy lead. The long final sentence carries the competitive-alternative guidance, so its length is earned rather than padding.

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?

For a 19-parameter, no-output-schema tool, the description covers the decision-relevant surface: what it searches, how modes differ, and when another tool wins. The remaining gap is that output behavior (inline code spans, dependency pointers, result shape) is left entirely to the schema field descriptions.

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?

Schema description coverage is 100%, so all 19 parameters are already documented and the baseline is 3. The description adds a conceptual model for the scoring (embeddings + keyword overlap) that makes fusion/weights/min-score parameters meaningful, but it says nothing about root/worktree handling, include_dependencies, or the inline_code output modes.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ('Search the codebase by MEANING') and immediately enumerates the three modes with what each matches. It conceptually separates itself from exact-symbol lookup, though it never names its actual siblings (grep, exact_references, skeleton) — it references an external LSP-backed MCP instead.

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?

Clear routing guidance: prefer an LSP tool for a known symbol name, and use this tool for 'meaning-based / fuzzy discovery across the whole repo.' Mode selection guidance is present. What's missing is exclusion guidance against the concrete siblings in this server (grep, exact_references, skeleton), which would make the choice trivial.

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