Skip to main content
Glama
KubaZ2

Agentic Filesystem MCP

grep

Search file contents with regular expressions to find matching lines, filter by glob patterns, and return content, file paths, or match counts.

Instructions

Searches file contents using regular expressions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
globNoThe glob pattern to filter files to be searched (e.g., `*.{ts,tsx}` or `src/**/*.rs`). Extremely useful for narrowing down searches and improving speed. Defaults to `null` if not specified.
pathNoThe directory or file to search in. Defaults to empty if not specified.
limitNoThe maximum number of lines to return. Useful for preventing token overflow when a pattern matches thousands of files/lines. Defaults to `100` if not specified.
offsetNoThe number of lines to skip. Used in combination with limit to paginate through large sets of matching lines. Defaults to `0` if not specified.
patternYesThe regular expression pattern to search for in file contents. Uses standard regex syntax. IMPORTANT: Remember to escape literal characters (e.g., `interface\{`).
multilineNoWhether to enable multiline mode where `.` matches newlines, `^` and `$` match line boundaries, and patterns can span multiple lines. Defaults to `false` if not specified.
output_modeNoThe output mode: `content` (matching lines), `files_with_matches` (paths only), or `count` (match counts per file). Defaults to `content` if not specified.
after_contextNoThe number of lines to show after each match to provide context. Requires `output_mode` to be `content` or omitted. Ignored otherwise. Defaults to `0` if not specified.
before_contextNoThe number of lines to show before each match to provide context. Requires `output_mode` to be `content` or omitted. Ignored otherwise. Defaults to `0` if not specified.
show_line_numbersNoWhether to show line numbers in the output. Requires `output_mode` to be `content` or omitted. Ignored otherwise. Defaults to `true` if not specified.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, so the description must carry the full burden of behavioral disclosure. It only states that the tool searches, but does not disclose that it is read-only, what output format to expect, or any side effects. This is a notable gap for a tool with no output schema.

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 a single sentence with no filler. It front-loads the core purpose and method, making it easy to parse quickly. Every word adds value.

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

Completeness2/5

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

Given the tool has 10 parameters, no output schema, and no annotations, the description is incomplete. It does not explain return values, line formatting, or why an agent should choose this over read or glob. The schema compensates for parameters, but the behavioral and output context 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 description coverage is 100%, so the parameters are fully documented in the schema. The description adds no additional parameter semantics, and the baseline of 3 is appropriate since the schema already handles the definitions.

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 ('Searches'), resource ('file contents'), and method ('using regular expressions'). This clearly differentiates grep from sibling tools like read (reading full contents) and glob (matching file paths).

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

Usage Guidelines2/5

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

No guidance is provided on when to use grep versus alternatives. The description does not mention conditions, exclusions, or sibling tools such as read or glob. An agent must infer usage solely from the purpose statement, which is not enough for clear tool selection.

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

Deploy Server

Other Tools