Skip to main content
Glama

Search file contents

grep_files
Read-onlyIdempotent

Search file contents by regex recursively to find matches in notes and documents on your everkeep server, with line numbers for follow-up reads or edits.

Instructions

Search file CONTENTS by regex, recursively. Per file returns path, rev, line count, then matching line numbers with their text. Long lines are clipped around the match (max_line_length, default 200). Line numbers and rev feed straight into read_text_file offset/limit and edit_file line edits. Documents (PDF, Word, spreadsheets…) are searched in their extracted text: matches as L (p.N / slide N / sheet Name), no rev; documents:false skips them. Other binaries and symlinks are skipped; output is capped and flags truncation when incomplete. To find files by name use search_files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile or directory (recursive)
contextNo±N lines around each match (default 0)
excludeNoGlob to skip
includeNoFilename glob, comma-separated: "*.md,*.yaml"
patternYesJavaScript regex
documentsNofalse skips documents. Default true
ignore_caseNo
max_resultsNoDefault 50
max_line_lengthNoDefault 200

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already establish readOnlyHint, idempotentHint, non-destructive behavior, and openWorldHint false. The description goes well beyond them by describing return structure per file, line clipping behavior, document extraction notation, skipped file types, and capped output with truncation signaling.

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?

The description is dense but front-loaded and every sentence contributes operational value: search scope, return format, document behavior, skip rules, truncation, and the sibling alternative. There is no filler or repetition of schema fields for their own sake.

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?

With no output schema and 9 parameters, the description provides the missing return-value context: per-file path, rev, line count, matching lines, document match notation, clipping, and truncation. Combined with annotations covering safety, an agent has what it needs to call and interpret the tool correctly.

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 description coverage is 89%, so the schema carries most parameter semantics. The description still adds useful meaning for max_line_length clipping, documents:false, and how line numbers/rev feed into read_text_file and edit_file, though it does not add much detail for context, exclude, include, ignore_case, or max_results beyond the schema.

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?

The description states a specific verb and resource: 'Search file CONTENTS by regex, recursively.' It distinguishes itself from search_files explicitly with 'To find files by name use search_files,' so an agent can tell it apart from the sibling that finds files by name rather than by content.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

It gives a clear when-to-use context: content search by regex. It names the alternative search_files and the condition that selects it, and it notes documents:false behavior plus skips for other binaries and symlinks, so exclusions are explicit rather than inferred.

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