Skip to main content
Glama

Grep across a site's files

search_files
Read-onlyIdempotent

Search every file of a site for a literal string or a regular expression: the served files by default, or the editable source tree with target 'source'. Use it before reading files in bulk, to find the ones that matter.

Input Schema

NameRequiredDescriptionDefault
globNoFile name filter, e.g. '*.js' or '*.{js,html}'.
nameNoSite name as shown by list_sites, e.g. my-portfolio. Provide name or siteId.
regexNoWhen true, pattern is an extended regular expression (BusyBox grep -E, no PCRE). Default false: literal match.
siteIdNoSite id from list_sites or get_site. Use instead of name.
targetNo'dist' (default) searches the served files; 'source' searches the editable source tree (get_site.sourceStored).
patternYesText to find (ASCII, max 500 chars). Literal unless regex is true.
maxMatchesNoCap on returned matches. Default 200, hard max 1000. Truncation is reported via budgetExceeded.
caseInsensitiveNoIgnore upper/lower case. Default false.

Output Schema

NameRequiredDescriptionDefault
nameYes
siteIdYes
targetYes
matchesYes
totalMatchesYes
budgetExceededYesTrue if the search hit maxMatches and there are likely more matches not returned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • changedInput schema / properties / caseInsensitive / description
      Previous value: -"Default: false. When true, adds -i to grep."New value: +"Ignore upper/lower case. Default false."
    • changedInput schema / properties / glob / description
      Previous value: -"Filename glob filter, e.g. '*.js' or '*.{js,html}'. Applied via find before grep so we don't read non-matching files."New value: +"File name filter, e.g. '*.js' or '*.{js,html}'."
    • addedInput schema / properties / name / description
      Added value: +"Site name as shown by list_sites, e.g. my-portfolio. Provide name or siteId."
    • changedInput schema / properties / pattern / description
      Previous value: -"Pattern to search for. Treated literal by default; pass regex:true to use as a basic regex (BusyBox grep BRE — no PCRE features)."New value: +"Text to find (ASCII, max 500 chars). Literal unless regex is true."
    • changedInput schema / properties / regex / description
      Previous value: -"When true, the pattern is interpreted as a basic regular expression. Default: false (literal substring match)."New value: +"When true, pattern is an extended regular expression (BusyBox grep -E, no PCRE). Default false: literal match."
    • addedInput schema / properties / siteId / description
      Added value: +"Site id from list_sites or get_site. Use instead of name."
    • changedInput schema / properties / target / description
      Previous value: -"Where to search. 'dist' (default) searches the served files. 'source' searches the editable source tree (requires Site.sourceStored=true)."New value: +"'dist' (default) searches the served files; 'source' searches the editable source tree (get_site.sourceStored)."
  2. Changed1 schema field changed
    • removedOutput schema / properties / request_id
      Removed value: -{
      -  "description": "Server-assigned request correlation id. Quote it when contacting support.",
      -  "type": "string"
      -}
  3. Changed1 schema field changed
    • addedOutput schema / properties / request_id
      Added value: +{
      +  "description": "Server-assigned request correlation id. Quote it when contacting support.",
      +  "type": "string"
      +}
  4. First observed

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is fully covered. The description's scope statements ('served files by default', 'editable source tree with target source') largely restate the target parameter description, and it adds no details on result truncation, match limits, or site-selection requirements.

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 compact sentences; the core capability is front-loaded and the workflow hint follows. No filler, no repetition of schema detail.

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 present, the description need not explain return values, and it covers scope, modes and workflow placement. Given eight parameters, it could note the result cap/truncation behavior and site scoping more explicitly, but nothing essential is missing for correct invocation.

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%, including the glob filter, regex flag, target enum, maxMatches cap and siteId/name choice, so the schema carries parameter meaning. The description only echoes the regex and target distinctions, adding no syntax or format guidance beyond it — the baseline 3 applies.

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 every file of a site') plus the two match modes (literal string or regular expression) and the two search scopes (served files vs. editable source tree). An agent can distinguish it from read_files/read_source_files 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 Guidelines4/5

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

Gives clear conditional guidance — 'Use it before reading files in bulk, to find the ones that matter' — which establishes the intended workflow position relative to the read_* siblings. It stops short of explicitly naming read_files/read_source_files or stating when not to use it, so it isn't a full 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.