Browse documentation

find

[symbols]

Searches files, content, declarations, code patterns, or semantic meaning within a repository.

Parameters

NameTypeRequiredDescription
responseDetailstringNocompact returns results and actionable state. full returns the original envelope with timing, revision, and display annotations. Default: "compact"
querystringYesThe search text, pattern, or path fragment. /re/ forces regex; "quoted" forces literal.
targetstringNoWhat to search: 'auto', 'files', 'content', 'symbols', 'structural', or 'semantic'. auto routes by query shape, except that a strict match (literal, regex, or word) routes auto to content. structural runs ast-grep patterns and symbols returns a declaration outline (symbol name/kind/container); both answer natively for the nine linked grammars and degrade to a lexical search elsewhere, with degraded naming the languages that had no grammar; semantic fuses embedding search with a lexical ranking over the same chunks. route.tier reports hybrid when both legs contributed and semantic when only the embeddings did. Its score orders one result set and is not a similarity. It is off by default; --semantic enables every startup root. Per-root semantic.enabled = true in .glider/scout/config.toml enables individual roots and Scout then downloads the embedding model once per user. Until the tier is ready it degrades to lexical fuzzy with degraded set. A requested-semantic find also carries semantic inline: state, plus percentComplete and etaSeconds while the index builds. Read etaSeconds to decide whether to wait on the build or take the lexical answer. After semantic.idle-evict-minutes idle (default 30), Scout evicts the resident index to free memory, then re-warms it from disk on the next query without a download. Default: "auto"
matchstringNoMatch mode: 'auto', 'fuzzy', 'literal', 'regex', or 'word'. Strict modes are exhaustive; fuzzy is ranked. auto picks fuzzy for files and literal for content; symbols use a deterministic name match (not fuzzy). 'word' searches whole words only, so a query that is merely part of a longer identifier matches nothing - use 'literal' for substring occurrences. A strict mode, and the /re/ and "quoted" markers, also pin target: auto to content. Default: "auto"
casestringNoCase handling: 'auto' (smart-case: sensitive when the query has an uppercase character), 'sensitive', or 'insensitive'. Default: "auto"
scopejsonNoOptional scope: pathPrefix (relative to each root), globs (! excludes), and languages. Unreleased: rootIds selects loaded roots; omission selects all. Use IDs from server_status. An empty list, duplicate IDs, and unknown IDs are rejected.
skipnumberNoPagination offset. Default: 0
takenumberNoMaximum matches to return; clamped to the configured maximum (default 200). Default: 50
maxPreviewCharsnumberNoPreview truncation length per match. Default: 200
pathStylestringNo'relative' (workspace-relative, forward-slash) or 'absolute'. Default: "relative"
continuationTokenstringNoResumes a scan or a saved fuzzy ranking. Use the same query, scope, and presentation options. Do not combine it with skip. Fuzzy snapshots survive file edits and expire after two minutes. Scan tokens are refused after index changes.

Examples

Replace sample paths and symbol keys with values from your workspace.

Compact literal content search

Arguments
{
  "query": "fn invalidate_cache",
  "target": "content",
  "match": "literal"
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find",
    "arguments": {
      "query": "fn invalidate_cache",
      "target": "content",
      "match": "literal"
    }
  }
}
Illustrative response
{
  "root": "/repo",
  "complete": true,
  "matches": [
    {
      "path": "src/cache.rs",
      "line": 42,
      "text": "fn invalidate_cache() {"
    }
  ]
}

Fuzzy file and identifier hop (ranked)

Arguments
{
  "query": "usrctrl"
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find",
    "arguments": {
      "query": "usrctrl"
    }
  }
}

Exhaustive regex over content

Arguments
{
  "query": "/fn handle_\\w+/",
  "target": "content"
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find",
    "arguments": {
      "query": "/fn handle_\\w+/",
      "target": "content"
    }
  }
}

Exhaustive word match scoped by globs

Arguments
{
  "query": "timeout",
  "target": "content",
  "match": "word",
  "scope": {
    "globs": [
      "src/**",
      "!**/tests/**"
    ]
  }
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find",
    "arguments": {
      "query": "timeout",
      "target": "content",
      "match": "word",
      "scope": {
        "globs": [
          "src/**",
          "!**/tests/**"
        ]
      }
    }
  }
}

Forced literal phrase

Arguments
{
  "query": "\"exact phrase\""
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find",
    "arguments": {
      "query": "\"exact phrase\""
    }
  }
}

Response Notes

Strict modes scan exhaustively; fuzzy and semantic results are ranked. Complete initial misses explain that ignore rules exclude files, including worktrees under ignored paths. Both response formats retain this hint and the searched root. Use load only if another checkout was intended. Compact responses report automatic routes and changes to the requested mode. Read the scout://guide MCP resource for grammar coverage, examples, and recovery.

Compact search returns root, complete, and matches with path, line, and text. Empty scopes retain zero coverage counts; partial scans retain coverage and recovery. complete describes exhaustive coverage; reason: ranked identifies ranked results.

next supplies replacement arguments for the same query and scope. A changed pageIdentity requires a restart without skip. Live scan identities fingerprint the content each scan reads. Disk edits change them before watcher delivery. Semantic identities track ranking changes. Strict scan resumes verify the earlier prefix with a separate budget equal to limits.find-budget-ms. A changed prefix or an exhausted verification budget requires a restart. An omitted column means 1; responseDetail: full retains the original envelope, timing, language tags, and spans.

Fuzzy pages use continuationToken to retain one ranking after file edits. The fuzzy content candidate scan shares one budget across backend pages. Its default is three seconds. Process options --parse-cap, --take-max, and --load override the configuration that supplies process policy. Overrides remain active after root changes and unload. Restart Scout to change them. Restart Scout with --find-budget to override it; 0 disables the deadline. The cache holds at most 32 snapshots and 32 MiB of serialized results. Snapshots expire after two minutes. Expiry, eviction, and reload require a restart without the token.

Incomplete fuzzy results withhold next. Retry without skip after the index is ready. Failed semantic queries report unavailable with recovery guidance. Read scout://guide for continuation rules, identity requirements, and recovery.

Unreleased multi-root support: scope.rootIds selects loaded roots. Omission selects all. The deepest loaded root owns overlapping files, even when a child root is unselected. Multi-root responses contain root: null, a root table, and rootId on each match. Paths are relative to the owning root. Counts, coverage, ranking, deadlines, and pagination cover the selected union. Explicit semantic search ranks enabled roots semantically. Whole-selection lexical fallback searches every selected root, including disabled roots. If any eligible root is warming, failed, or incompatible, the entire selection uses lexical fallback. Automatic semantic routing requires all selected roots to be enabled, ready, and compatible. Mixed symbol results place native declarations before globally ranked fuzzy fallback candidates. Each lane reserves half the shared candidate horizon.