Skip to main content
Glama

Search source files

websiteSourceCode_files_search
Read-onlyIdempotent

Finds text across every source file and returns one entry per matching line with its file name, line, and column. Call this first to locate code, then read only the files it names with websiteSourceCode.files.read. pattern is literal text unless isRegex is set, and matching is line by line, so a pattern cannot span a newline. Narrow with nameGlob and type, ask for surrounding lines with contextLines, or set filesOnly for the cheapest orientation. Results are cursor-paginated over matches.

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

Input Schema

NameRequiredDescriptionDefault
typeNoOnly search files of this type.
limitNoMaximum matches to return per page. Defaults to 20, maximum 100.
cursorNoOpaque cursor from the previous page. Pass the returned `version` too to keep the search pinned.
targetNoVersion alias to read: `head` (default) or `published`.
isRegexNoRead `pattern` as a regular expression. JavaScript syntax works, including `\b`, `\d`, lookahead, and lazy quantifiers; named capture groups are not supported.
patternYesText to find. Literal unless `isRegex` is set. Matched line by line, so `^` and `$` anchor to line boundaries and a pattern cannot span a newline.
versionNoExplicit source version. Takes precedence over `target`.
nameGlobNoOnly search names matching this glob. `*` and `?` stop at a `/`; `**` crosses them, for example `blog/**`.
filesOnlyNoReturn one entry per matching file, with no line detail.
websiteIdYes
contextLinesNoSurrounding lines to return on each side of a match (0 to 3). Defaults to 0.
caseSensitiveNoMatch case exactly. Defaults to `true`.
maxMatchesPerFileNoMaximum matches from any one file (up to 50). Defaults to 10.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior4/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), and the description adds matching semantics (line-by-line, cannot span newlines), pagination via cursor, and a cost cue ("filesOnly for the cheapest orientation"). It stops short of stating defaults for limit/caseSensitive or how cursor+version pinning interact beyond what the schema says, so it is strong but not exhaustive.

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?

Front-loads the verb and result shape, then the workflow, then the matching semantics and narrowing options. Every sentence carries information an agent would otherwise have to infer; there is no filler.

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?

For a 13-parameter search tool with no output schema, the description still explains the return value (per-line entries with file/line/column, or per-file with filesOnly) and pagination. An agent has everything needed to call it correctly and to know what comes back.

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 92%, so the baseline would be 3; the description earns extra by explaining how parameters interact rather than restating them — isRegex flips pattern interpretation, line-by-line matching constrains regex anchors, nameGlob/type narrow scope, filesOnly trades detail for cost. Required parameter websiteId is still left entirely to the schema, which keeps it just below 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 ("finds text across every source file") plus the exact result shape (one entry per matching line with file name, line, column). It is immediately distinguishable from the sibling websiteSourceCode_files_read, which it calls out as the follow-up step.

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?

Gives an explicit workflow: "Call this first to locate code, then read only the files it names with websiteSourceCode.files.read." It also names the narrowing levers (nameGlob, type, contextLines, filesOnly) so an agent can pick the right call shape without trial and error.

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.

Resources