Skip to main content
Glama
sangingeum
by sangingeum

content_search

Read-onlyIdempotent

Search file contents by literal text or regular expression to find matching lines with paths, line numbers, and columns; read-only and skips binary files.

Instructions

Search file contents by literal text (default) or a regular expression.

    Read-only. Matches carry path, 1-based line number, column and the whole
    line. At most 200 matches may be requested; a larger request is refused
    with LIMIT_EXCEEDED and a truncated result says so. An invalid regular
    expression is INVALID_PATTERN. Binary files are skipped.
    

Input Schema

NameRequiredDescriptionDefault
globNo
pathYes
queryYes
regexNo
max_resultsNo
case_sensitiveNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.8

TDQS

A3.9/5.0
Behavior5/5

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

With readOnlyHint already declared by annotations, the description goes well beyond: it names the 200-match cap, the LIMIT_EXCEEDED refusal for oversized requests, the truncation marker on truncated results, INVALID_PATTERN for bad regexes, and that binary files are skipped. It also discloses the shape of each match (path, 1-based line, column, whole line) in the absence of an 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the mode selection and read-only status, then error and match-format details. Every sentence carries information; the only mild redundancy is the trailing whitespace/linebreak formatting rather than content.

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?

Covers the critical unknowns for a read-only search tool: match shape (since no output schema exists), result cap and truncation behavior, and error codes. Missing coverage of glob filtering and case-sensitivity default keeps it from being fully complete.

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 0%, so the description must carry parameter meaning. It covers query (literal vs regex), the regex toggle, and the max_results ceiling, but leaves glob, path, and case_sensitive (which defaults to true) entirely unexplained — a notable gap for half the parameters.

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 — search file *contents* — which implicitly distinguishes it from the name-based file_search sibling. It doesn't explicitly name file_search or file_read as the alternatives, so differentiation is left partly to inference.

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 'literal text (default) or regular expression' phrasing tells the agent which mode to pick via the regex flag, but there is no guidance on when to use this instead of file_search (name matching) or file_read. Usage is implied by the tool's scope rather than stated.

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