Skip to main content
Glama

grep_search

Search file contents under a specified path using plain text or regular expressions, with optional case-insensitive matching for targeted code and text lookups.

Instructions

Search file contents under a path. Prefer this over a shell grep.

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": {
      "Path": "<Path>",
      "Query": "<Query>"
    },
    "name": "grep_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
PathYesAbsolute file or directory.
QueryYesText to find. A regular expression when IsRegex is true.
IsRegexNoTreat Query as a regular expression.
CaseInsensitiveNoIgnore case.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden, and it says almost nothing: no disclosure of recursion behavior, result limits, ignore-file handling, performance characteristics, or read-only semantics. The only behavioral hint is that it substitutes for shell grep, which is thin for an unannotated search tool.

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?

Two short sentences, zero filler, with the core action front-loaded before the routing hint. Every sentence earns its place and nothing is buried.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained, and parameters are fully covered by the schema. What remains missing is operational context an agent needs before invoking a filesystem search: recursion scope, result caps, and handling of unreadable or binary files.

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 Path, Query, IsRegex, and CaseInsensitive are already documented in the schema. The description adds no extra meaning about parameter interaction (e.g., regex vs literal matching implications) beyond the baseline.

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?

"Search file contents under a path" gives a specific verb (search) plus a resource (file contents) and scope (under a path), which separates it from filename-oriented siblings like find_by_name. It never explicitly names those siblings, so differentiation is implied rather than stated.

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?

"Prefer this over a shell grep" is a concrete routing instruction toward a real alternative the agent would otherwise reach for (run_command/execute). It stops short of stating when-not to use it, e.g., searching by filename or scanning binary/large trees.

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