Skip to main content
Glama

fs_search

Read-onlyIdempotent

Search the text files a project stores (source, JSON, markdown, HTML, CSS and similar; binaries are skipped). The answer's mode says how it searched:

  • fts5 (normal): the project's search index. Each run of ASCII letters and digits in the query matches the start of a word, ignoring case. Results are { path, snippet }, best first. Each write indexes the first 1,048,576 characters of a text file; when the index is built for files already stored, files over 1,048,576 bytes are skipped.

  • scan (when the index is not ready or falls back, and for preview files): a literal, case-sensitive match, line by line, over at most max_files files, skipping files over 1,048,576 bytes. Results are { path, line, snippet, before, after } and the answer adds files_scanned. A production scan schedules index backfill.

truncated: true means the answer reached limit, so there may be more. A 503 FILE_INDEX_UNAVAILABLE means the index needs recovery; a later search succeeds once it recovers.

Example:

// Files that mention the auth client:
{ "project_id": "my-saas", "path": "/", "query": "createSomewhereAuth" }

// Scoped to a subtree:
{ "project_id": "my-saas", "path": "/src/api/", "query": "TODO" }

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": {
      "project_id": "<project_id>",
      "query": "<query>"
    },
    "name": "fs_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoDirectory to search under (defaults to "/"). Trailing slash optional.
limitNoMax matches to return (default 50, cap 500).
queryYesText to search for, up to 500 characters. Indexed search matches words, ignoring case; the scan fallback matches it literally and case-sensitively.
max_filesNoMax files the scan fallback reads (default 500, cap 2,000). Not used by indexed search.
project_idYesProject ID (UUID), subdomain, or slug — resolved server-side, no UUID lookup needed. 'default' also works when the account has exactly one project; multi-project accounts must name one (the error lists them).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and idempotentHint; the description adds the material behavior an agent needs: word-prefix, case-insensitive matching under fts5 versus literal, case-sensitive line scanning, result shapes differing per mode, the 1,048,576-byte indexing/skip threshold, max_files bounds, and that a production scan schedules index backfill. That backfill scheduling is a server-side side effect not implied by the read-only annotation, and the description is right to disclose it.

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 core statement, then structured bullets per mode plus two concrete request examples — dense but every sentence carries information an agent would otherwise have to discover by failure. The byte-threshold detail is repeated in both bullets, which is slightly wasteful but keeps each mode self-contained.

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?

There is no output schema, and the description compensates by documenting both return shapes ({path, snippet} vs. {path, line, snippet, before, after}), the added `files_scanned` field, and the `truncated` and 503 signals. For a five-parameter search tool with no output schema, nothing an agent needs in order to call it correctly 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 genuinely adds meaning: how `query` is interpreted differs per mode (word-prefix/case-insensitive vs. literal/case-sensitive), how `limit` manifests as `truncated: true`, and that `max_files` only applies to the scan fallback. `path` and `project_id` are left entirely to the schema, which already documents them well.

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: searching the text files a project stores, with an explicit scope note that binaries are skipped and examples of covered types (source, JSON, markdown, HTML, CSS). It does not explicitly contrast itself with siblings like fs_glob or fs_read, so the differentiation (content search vs. filename/read) is left implicit rather than stated.

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 strong conditional guidance on which internal mode produces the answer (fts5 when the index is ready, scan when it is not ready or falls back, and for preview files) and what to do on a 503 FILE_INDEX_UNAVAILABLE. It stops short of tool-level routing guidance — nothing tells the agent when to prefer this over fs_glob or fs_read.

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