Skip to main content
Glama
local-context
by JustinA988

search_text

Read-only

Search files under an allowed root for text or regex and return capped matching lines. Set a path, match limit, and regex mode to find content.

Instructions

Search text under an allowed root. Returns capped matching 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 directory. Defaults to the root.
limitNoMax matches.
queryYesText or regex to find.
regexNoTreat query as a regex.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

The annotations already declare read-only, non-destructive, and closed-world behavior. The description adds useful behavioral context beyond those annotations: searches are confined to an allowed root, and returned matching lines are capped. It does not explain how the cap is surfaced or whether truncated results are indicated, which keeps it from a 5.

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 two short sentences with no wasted wording. The scope constraint and the return behavior are front-loaded and easy to parse.

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?

For a simple read-only search tool with full schema parameter documentation and annotations covering safety, the description provides enough context to call it correctly. It states the search scope and that results are capped, though it could say more about truncation or result formatting since no output schema exists.

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 schema already documents path, limit, query, and regex semantics. The description reinforces that search is scoped to an allowed root and that results are capped, but adds little parameter-specific meaning beyond the schema. Baseline 3 is appropriate.

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 uses a specific verb and resource: 'Search text under an allowed root.' It clearly communicates that this is a text-search operation rather than a file-listing or whole-file-read operation. It does not explicitly distinguish itself from all siblings, but the action and scope are clear.

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

Usage Guidelines3/5

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

The description implies the tool should be used when searching for text under a permitted root, and the schema confirms regex is optional. It does not explicitly say when to use this instead of read_file, list_dir, or query_sql, nor does it state exclusions. Usage is implied rather than guided.

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