Skip to main content
Glama

repo_search

Read-only

Searches code at a ref (task branch, tag or sha) like git grep, returning path:line: text lines: query - a literal string (case-insensitive unless caseSensitive), queries - up to 10 strings, regex - a per-line JavaScript regular expression that filters query matches or, without query, scans the files under path. Up to 200 lines and 50 files per query (truncated beyond); an empty result means no match at that ref.

Input Schema

NameRequiredDescriptionDefault
refNoBranch, tag or sha; defaults to the default branch.
pathNoDirectory prefix (src/services) or glob (src/**/*.spec.ts).
limitNoMaximum matching lines per query.
queryNoLiteral string: an identifier or a phrase.
regexNoJavaScript regular expression matched per line.
contextNoContext lines around each match; default 2.
queriesNoSeveral literal strings, up to 10.
wholeWordNoWhole words only.
extensionsNoFile extensions without the dot: ts, html.
repositoryIDYesRepository ID.
caseSensitiveNoCase-sensitive matching; default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Added
  4. Removed
  5. Added
  6. Removed
  7. Changed1 schema field changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
  8. Added
  9. Removed
  10. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already carry the safety profile (readOnly, non-destructive, closed-world), and the description layers on real behavior: result format, a hard cap of 200 lines and 50 files per query that silently truncates, empty-result-means-no-match semantics, and default case-insensitivity. It does not cover authorization, rate limits, or whether truncation is signalled in the response.

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 is front-loaded in the first clause, followed by a compact colon-list of parameter semantics and the limits clause. The result is one dense sentence that reads as slightly run-on, but for an 11-parameter tool with no output schema nearly every clause carries information.

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?

With no output schema, the description compensates by specifying the return line format and the truncation ceiling, and annotations cover the safety profile. Remaining gaps are minor: no pagination/continuation story beyond truncation and no note on what happens when both query and queries are supplied.

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 100%, so the baseline is 3, but the description adds interaction semantics the schema cannot express: regex filters query matches when query is present yet scans files under path when it is absent, and queries accepts up to 10 strings. It also restates query as literal and case-insensitive by default, which corroborates rather than merely repeats the schema.

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?

States a specific verb (Searches) and resource (code at a ref) and anchors it with the 'like git grep' analogy plus the concrete `path:line: text` output shape, which lets an agent separate it from repo_file or repo_tree. It never names a sibling tool or states what it is not, so it falls short of the explicit sibling differentiation a 5 requires.

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

Usage Guidelines3/5

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

Usage is only implied: the query/regex/queries clauses tell an agent how to combine parameters, and the truncation note hints at scope, but there is no 'use this instead of repo_context when...' routing guidance. With ~60 sibling tools including several repo_* readers, that omission leaves selection to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources