Skip to main content
Glama
axross-headless-mcp

axross-headless-mcp

Search file contents

search_content
Read-onlyIdempotent

Find which files contain a word or pattern by searching file contents with a regular expression. Returns matching lines with file paths and line numbers.

Instructions

Search file contents under a folder for lines matching a regular expression. Use when: finding which files contain a word or pattern, with line numbers. Instead: search_index or walk_tree to match names; read_file for a whole file. Behavior: read-only, breadth-first; include narrows by file name. Files are read as UTF-8, binary ones too (bad bytes: U+FFFD); over 4 MiB they are skipped; lines are cut at 500 characters. Patterns with nested quantifiers or slower than 5 s on a file are refused (ReDoS). Secret files go to unreadable. Time limit: 60 s. Returns: {matches: [{path, line_no, line}], files_scanned, truncated (max_matches, or a folder at max_depth not searched), unreadable, complete}. An empty result with complete=false does not mean the pattern is absent; when truncated, narrow path or include.

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": {
      "pattern": "<pattern>"
    },
    "name": "search_content"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoThe folder to search (absolute, or relative to the MCP root); default the MCP root, '/' on a remote backend.
backendNoBackend id from list_backends; omit for the default.
includeNoOnly files whose name matches this glob, case-sensitive, e.g. '*.py' or '*.[ch]'.
patternYesA Python regular expression, matched against each line, e.g. 'import|require' or '(?i)password'.
path_b64Nopath as base64 of its raw bytes, for non-UTF-8 names; replaces path.
max_depthNoLevels to visit, counted from 1: 1 = path's own entries.
max_matchesNoMost matching lines to return.

Output Schema

NameRequiredDescriptionDefault
matchesYes
completeYes
truncatedYes
unreadableYes
files_scannedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.15.181

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the read-only/idempotent annotations by disclosing traversal order (breadth-first), encoding behavior (UTF-8, replacement chars for binary), the 4 MiB skip threshold, 500-character line cutting, ReDoS refusal for nested quantifiers or patterns slower than 5 s, secret files becoming unreadable, and a 60 s time limit. These are exactly the constraints an agent cannot infer from annotations or 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?

Telegraphic and front-loaded: purpose, when-to-use, alternatives, behavior, returns, and the failure-mode caveat each get one compact block. No filler sentences, and the most decision-relevant routing information comes before the behavioral detail.

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

Completeness5/5

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

Seven parameters, a 60 s budget, and truncation semantics are all addressed; even though an output schema exists, the description still supplies the crucial interpretation that complete=false with empty matches does not prove a pattern's absence. Nothing needed for correct invocation is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds meaning: include narrows by file name, and it explains that max_matches or an unsearched folder at max_depth produce truncated=true, plus how to react. It does not describe path_b64 or the glob syntax beyond the schema's own examples, so it stops short of a 5.

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?

States a specific verb and resource: search file contents for lines matching a regex, with line numbers. The 'Instead' clause explicitly separates it from search_index and walk_tree (name matching) and read_file (whole-file reads), so the agent can pick it without opening any schema.

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

Usage Guidelines5/5

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

Explicit 'Use when' condition (finding which files contain a word or pattern) paired with named alternatives and the condition that selects them: search_index/walk_tree for names, read_file for whole files. It also gives recovery guidance when truncated: narrow path or include.

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