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

TableJSON 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. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so safety is covered. The description adds real behavioral context beyond that: hard caps of 200 lines and 50 files per query, truncation beyond those, case-insensitivity defaulting, and empty-result meaning. It does not describe error conditions or ref-resolution failures.

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?

Dense and front-loaded with purpose first, then parameter modes, then limits. It is effectively one very long sentence with heavy parenthetical nesting, which slightly hurts scanability, but nearly every clause carries information an agent needs.

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 an 11-parameter tool with no output schema, the description covers the return format, per-query caps, and the query/regex interplay. It leaves unaddressed multi-repo or auth scoping and error behavior, but nothing critical for a correct call is missing.

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 baseline is 3, but the description genuinely adds semantics the schema does not: regex 'filters query matches or, without query, scans the files under path' — a two-mode interaction no parameter description conveys, plus the query/queries relationship and the caseSensitive override. Useful added value over structured fields.

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 with scope ('searches code at a ref (task branch, tag or sha)'), anchors it to a familiar mental model ('like git grep'), and describes the exact output shape ('path:line: text' lines). This is enough to distinguish it from siblings like repo_file, repo_blame, and repo_history without opening any schema.

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 implied rather than stated: 'query' vs 'queries' vs 'regex' establish when each mode applies, and 'an empty result means no match at that ref' clarifies outcome semantics. But no sibling is named (e.g. feature_search, repo_blame) and there are no explicit when-not-to-use conditions, so an agent must infer routing.

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