Skip to main content
Glama

grep_search

Search files and directories for exact text or regular expression matches, with optional glob filters and case-insensitive matching. Locate code across Local, Remote-SSH, or WSL workspaces.

Instructions

Search for exact text or regular expression matches inside files or directories (works across Local and Remote-SSH/WSL).

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

Input Schema

NameRequiredDescriptionDefault
QueryYesThe search string or regular expression pattern.
IsRegexNoTreat Query as a regular expression.
IncludesNoOptional glob filters for filenames.
SearchPathYesThe file or directory path to search.
MatchPerLineNoReturn matching line numbers and snippets (default true).
CaseInsensitiveNoPerform case-insensitive matching.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden, yet it discloses almost no behavior: it does not state that the operation is read-only, whether results are capped or truncated, how binary/large files are handled, or what errors look like. The only real behavioral detail is the Local/Remote-SSH/WSL environment coverage.

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?

A single front-loaded sentence with zero filler, and the environment scope is appended as a compact parenthetical. It is efficient, though the parenthetical space could have been spent on usage guidance instead.

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?

For a six-parameter search tool with no annotations and no output schema, the definition covers the core purpose but leaves return shape, result limits, and read-only guarantees unaddressed. It is adequate for an agent to call it correctly but not to predict its output or failure modes.

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 each of the six parameters is already documented in the schema. The description adds no additional semantics such as how IsRegex interacts with Query or what a SearchPath pointing at a single file versus a directory changes, so baseline 3 applies.

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 and resource: exact text or regex searches inside files/directories. This clearly distinguishes it from siblings like find_by_name (name-based lookup) and read_file (whole-file read), though it never names an alternative explicitly.

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 by the verb 'search inside files' and the note that it works across Local and Remote-SSH/WSL, but there is no explicit when-to-use/when-not guidance or pointer to a competing tool for name-based lookup.

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