Skip to main content
Glama

Grep

grep

Search source code using regular expressions to locate specific patterns, functions, or errors. Specify a path to narrow results and control context lines for faster issue diagnosis.

Instructions

正则搜索代码

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNo
contextNo
patternYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.7/5.0
Behavior2/5

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

There are no annotations, so the description carries the full burden of behavioral disclosure. It only says 'regex search code' and does not explain scope, default path, whether the search is recursive, how 'context' is used, or what gets returned. The behavior is implied but not disclosed.

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?

The description is extremely short and front-loaded, with no wasted words. However, it is under-specified for a 3-parameter tool, so while concise, it is not fully 'appropriately sized' for the decision-making context.

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?

With no annotations, minimal parameter semantics, and an output schema present but no explanatory description, an agent lacks key contextual information like default scope, usage boundaries, and sibling alternatives. The definition is adequate for recognizing a grep-like tool but not for robust tool selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description adds almost no parameter-level meaning beyond the schema's names. The word 'regex' clarifies that 'pattern' is a regex, but 'path' and 'context' are left unexplained, so the description fails to compensate for the low schema coverage.

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?

The description states a specific verb and resource: '搜索' (search) with '代码' (code) using regex, so the core action is clear. It does not differentiate from the sibling tool 'search_code', which could overlap, so it falls short of a 5.

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 given on when to use this tool instead of alternatives like 'search_code' or 'read_file'. The description implies 'use this for regex code search' but provides no exclusions, prerequisites, or comparison to siblings.

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