find

[symbols]

Primary search over the workspace. Strict modes (literal, regex, word) are exhaustive with deterministic order; fuzzy is ranked top-N with frecency. target: auto routes by query shape, and every response echoes the resolved route in data.route.

Why this tool exists

Text search is the highest-frequency agent operation, and shell tools give unranked, unscoped output that ignores editor-fresh changes.

How it helps the agent

One tool covers ranked fuzzy discovery and exhaustive grep-grade audits, with scoping, pagination, previews, and a route echo that makes auto behavior observable.

Parameters

NameTypeRequiredDescription
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. In this release, symbols, structural, and semantic answer from the lexical tier with meta.degraded set.
matchstringNoMatch mode: 'auto', 'fuzzy', 'literal', 'regex', or 'word'. Strict modes are exhaustive; fuzzy is ranked. auto picks fuzzy for files/symbols and literal for content.
casestringNoCase handling: 'auto' (smart-case: sensitive when the query has an uppercase character), 'sensitive', or 'insensitive'.
scopejsonNoOptional scope: pathPrefix (workspace-relative directory), globs (prefix with ! to exclude), and languages (tokens like rust, typescript, csharp).
skipnumberNoPagination offset.
takenumberNoMaximum matches to return; clamped to the configured maximum (default 200).
maxPreviewCharsnumberNoPreview truncation length per match.
pathStylestringNo'relative' (workspace-relative, forward-slash) or 'absolute'.

Examples

Fuzzy file and identifier hop (ranked)

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find",
    "arguments": {
      "query": "usrctrl"
    }
  }
}

Exhaustive regex over content

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

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

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

Response Notes

Returns matches with workspace-relative path, 1-based line and column, and a trimmed preview; data.route echoes the resolved target and match, and paging carries skip/take/total. exhaustive: true confirms a strict search saw every match; when a limit is hit (match cap, oversized file, time budget) exhaustive flips to false with meta.partial set and the total marked as a floor - never silent truncation. A zero-hit strict search is a valid empty result with a hint suggesting a fuzzy retry; Scout never silently falls back.

↑/↓ NavigateEnter OpenSpace Expand