Skip to main content
Glama

repo_search

Idempotent

Search repository code for answers to open-ended questions using BM25 and graph neighbors. Locate implementations, find error strings. Returns cited code chunks.

Instructions

Search repository code for answers to questions using BM25 lexical ranking expanded with graph neighbours. Read-only, no side effects, secret files (.env) excluded. When to use: use for open-ended queries, locating implementations, or finding error strings. When NOT to use: do not use when you already have a symbol node_id and want callers/callees (use repo_neighbours); do not use for broad repo layout (use repo_map). Output: markdown citation blocks [cite: path:start-end] bounded by budget_tokens.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kNoNumber of initial seed chunks retrieved via BM25 lexical scoring (default 8, max 50).
hopsNoGraph traversal depth around seed chunks (default 1, max 4; 0 returns seeds only).
queryYesNatural language question, search terms, or symbol identifier to search for (e.g. 'pack_context' or 'how does export work').
budget_tokensNoMaximum token ceiling for returned markdown pack (default 6000, max 12000; zero or negative uses the default).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.0.0
    • changedInput schema / properties / budget_tokens / description
      Previous value: -"Maximum token ceiling for returned markdown pack (default 6000, max 12000)."New value: +"Maximum token ceiling for returned markdown pack (default 6000, max 12000; zero or negative uses the default)."
  2. Changed4 schema fields changedv1.5.1
    • changedInput schema / properties / budget_tokens / description
      Previous value: -"max 12000"New value: +"Maximum token ceiling for returned markdown pack (default 6000, max 12000)."
    • changedInput schema / properties / hops / description
      Previous value: -"graph hops (default 1, max 4)"New value: +"Graph traversal depth around seed chunks (default 1, max 4; 0 returns seeds only)."
    • changedInput schema / properties / k / description
      Previous value: -"seed chunks (default 8, max 50)"New value: +"Number of initial seed chunks retrieved via BM25 lexical scoring (default 8, max 50)."
    • changedInput schema / properties / query / description
      Previous value: -"the question"New value: +"Natural language question, search terms, or symbol identifier to search for (e.g. 'pack_context' or 'how does export work')."
  3. First observedv0.1.0

TDQS

A3.7/5.0
Behavior1/5

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

The description asserts 'Read-only, no side effects' while the annotations declare readOnlyHint=false. That is a direct conflict about whether the tool mutates state, which is exactly the kind of trait an agent relies on annotations for. The genuinely useful detail (secret files such as .env are excluded) is undercut by the contradiction.

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 the mechanism, then uses labelled 'When to use' / 'When NOT to use' / 'Output' blocks so the routing information is scannable. It is dense but every sentence carries distinct information; slightly over-packed for its length.

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?

Even without an output schema, the description specifies the return shape (markdown citation blocks `[cite: path:start-end]` bounded by budget_tokens) and the retrieval pipeline, so an agent knows what it will get back. The unresolved read-only/readOnlyHint conflict is the only material gap.

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 k, hops, query, and budget_tokens are already fully documented with defaults and ranges; baseline 3 applies. The description only echoes budget_tokens as the output bound and adds no syntax or format detail beyond the schema.

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 (search), resource (repository code), and the retrieval mechanism (BM25 lexical ranking expanded with graph neighbours), which is distinctive enough to separate it from every sibling. It also names the exact query types it serves (open-ended queries, locating implementations, error strings).

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?

Provides explicit 'When to use' and 'When NOT to use' sections, and routes the agent to the correct sibling in each exclusion case (repo_neighbours when you have a symbol node_id; repo_map for broad layout). Nothing is left to inference.

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