Skip to main content
Glama

repo_search

Read-onlyIdempotent

Search tracked repository files with git grep to locate code by pattern before reading; returns path:line:text matches, is read-only, and skips untracked files.

Instructions

Search tracked files of the repo with git grep -n and return matching lines as 'path:line:text', or '(no match)'. Read-only. Use it to locate code before repo_read; untracked files are not searched and long output is truncated to the last 60 KB.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pattern": "<pattern>"
    },
    "name": "repo_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
patternYesgit grep pattern (basic regex, case-sensitive), e.g. 'def main' or 'TODO'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds genuinely useful operational detail beyond them: the grep mechanics, the '(no match)' sentinel, and the last-60-KB truncation of long output. It omits match limits or paging behavior, so it is good but not complete.

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?

Three compact sentences: purpose and return format first, then the read-only/usage placement, then the caveats. Every clause carries information (output format, exclusion, truncation) with 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?

For a single-parameter search tool with no output schema, the description supplies the return format, the empty-result sentinel, the untracked-file limitation and the truncation ceiling. Nothing an agent needs in order to call it and interpret results is missing.

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 coverage is 100% and the only parameter already documents that the pattern is a case-sensitive basic regex with examples. The description adds no syntax or format meaning beyond that, so the baseline of 3 applies.

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 and resource (search tracked repo files via `git grep -n`), specifies the exact return shape 'path:line:text' / '(no match)', and implicitly separates itself from repo_read by being the locate step. An agent can distinguish it from all listed siblings without 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 Guidelines4/5

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

Explicitly routes usage: 'Use it to locate code before repo_read', and states a hard boundary that untracked files are not searched. It stops short of naming alternatives for cases like diffing or history inspection (e.g. git_diff), but the positive workflow guidance is clear and actionable.

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