Skip to main content
Glama

repo_search

Idempotent

Search repository code for answers to questions using BM25 lexical ranking expanded with graph neighbours. Read-only, no side effects, secret files (.env) excluded.

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. To page, pass cursor="" then each next_cursor: token from the reply's last line.

Input 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').
cursorNoOpt-in paging. Omit for one unpaged answer. Pass "" for the first page of k seed results; while more remain the reply ends with a `next_cursor: <token>` line (also _meta.nextCursor). Pass that token back, other arguments unchanged, for the next page.
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 changedv4.0.0
    • addedInput schema / properties / cursor
      Added value: +{
      +  "description": "Opt-in paging. Omit for one unpaged answer. Pass \"\" for the first page of k seed results; while more remain the reply ends with a `next_cursor: <token>` line (also _meta.nextCursor). Pass that token back, other arguments unchanged, for the next page.",
      +  "type": "string"
      +}
  2. 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)."
  3. 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')."
  4. First observedv0.1.0

TDQS

A3.9/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," but the annotations declare readOnlyHint=false, a direct conflict about whether this tool mutates state. Although the description usefully adds secret-file exclusion and pagination mechanics, the contradiction with structured safety metadata forces a 1 under the scoring rule.

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?

Front-loaded with the core purpose, then cleanly segmented into when-to-use, when-not-to-use, output, and paging. Dense but every sentence carries routing or behavioral information; no 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?

With no output schema, the description supplies the return format (markdown `[cite: path:start-end]` blocks), the budget_tokens bounding behavior, and the full cursor paging loop including the `next_cursor:` token location. That is complete enough for an agent to invoke and iterate correctly.

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, cursor, and budget_tokens are already documented at the field level (baseline 3). The description restates the budget and cursor paging behavior but adds no format, range, or interaction detail beyond what the schema already provides.

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 ("Search repository code") plus the retrieval mechanism (BM25 lexical ranking expanded with graph neighbours), which is enough to distinguish it from repo_map and repo_neighbours. An agent knows exactly what class of operation this is before opening the schema.

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?

Explicitly enumerates when to use (open-ended queries, locating implementations, finding error strings) and when NOT to use, naming the correct sibling for each excluded case (repo_neighbours for callers/callees from a node_id, repo_map for broad layout). This is textbook routing guidance.

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