Skip to main content
Glama

Search Text

search_text
Read-onlyIdempotent

Find text or regex matches across files and folders, returning path:line results with optional glob, case, context, and result-limit controls.

Instructions

Grep across files (ripgrep speed when installed). Returns 'path:line: text' lines.

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": {
      "query": "<query>"
    },
    "name": "search_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoFile or folder to search..
queryYesText or regex to search for inside files.
regexNoTreat query as a regular expression.
file_globNoOnly search files matching this glob, e.g. '*.py'.
max_resultsNoMax matching lines to return.
context_linesNoLines of context before/after each match (0-5).
case_sensitiveNoMatch case.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the bar is low; the description adds the concrete return shape and the 'ripgrep speed when installed' nuance. It omits behavior that materially affects results, such as whether gitignored/binary files are skipped and whether hits are silently truncated at max_results.

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?

Two short sentences, no waste, with the core action front-loaded and the return format immediately after. Nothing could be removed without losing information.

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?

With an output schema and full annotation coverage, the description only needs to frame the operation, which it does. The remaining gap is that result truncation and file-exclusion behavior go unstated for a tool whose results are capped by default.

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 all seven parameters are already fully documented in the schema. The description adds no syntax or format detail beyond that, so the 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 ('Grep across files') plus the output line format, so the agent immediately knows this searches file contents rather than names. It never names a sibling such as find_files or read_many_files, so the differentiation is left implicit.

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?

There is no when-to-use or when-not-to-use guidance, and no mention of the obvious alternative (find_files, which presumably matches on filenames/globs). The agent must infer content-search vs filename-search from the word 'grep' alone.

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