Skip to main content
Glama

grep

Read-only

Search remote file contents with regular expressions over SSH. Returns matching lines with line numbers, grouped by file, capped at 250 matches; skips binary and .git.

Instructions

Search file contents with a regular expression (POSIX ERE on the remote grep; ripgrep-only syntax like \p{...} is unsupported). Returns matching lines with line numbers, grouped by file, capped at 250 matches. REMOTE: the search runs on selected target (ssh target.ssh); binary files and .git are skipped.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoFile or directory to search, on the remote host selected target. Defaults to the target root; a relative path resolves against it.
targetYesExact target name from remote_ssh_targets list. Always select the intended host explicitly.
includeNoOne glob filter for which files to search (e.g. "*.ts"). Not a list; negation is not supported.
patternYesRegular expression to search for (extended regex).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true, openWorldHint=true, destructiveHint=false, so safety is covered. The description adds valuable behavior: POSIX ERE limits, remote execution, binary/.git skipping, and a 250-match cap. These are concrete operational details not in annotations. Missing why the cap exists or what happens on overflow, but strong overall.

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 short sentences, front-loaded with the core action and regex syntax note, then output behavior, then remote execution constraints. No wasted words; every clause is informative.

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?

Covers regex flavor, output format (grouped, line numbers, cap), remote execution, and file exclusions. With no output schema, it explains the return structure well. Could mention error handling or performance implications, but it's complete enough for correct invocation.

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%, so all parameters are documented in the schema. The description mentions regex syntax (POSIX ERE) and implies the search runs remotely, which aligns with the 'target' parameter, but adds no new details about 'path', 'include', or parameter interactions. Baseline 3 for high coverage.

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?

Specific verb+resource: 'Search file contents with a regular expression.' It distinguishes itself from the sibling 'glob' by implying content search rather than filename search, and from 'read' by its search semantics. An agent can immediately tell what this tool does.

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?

States the search operates on a remote target and requires explicit target selection, which differentiates it from a local search. However, it doesn't explicitly say when to use this over 'glob' (filename matching) or 'read' (full file reading), leaving some inference to the agent.

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