enquire-mcp API reference - v4.0.0-rc.7
    Preparing search index...

    Function searchText

    • Substring-grep search over the vault: scans every .md body for token occurrences in all / any / phrase mode and ranks by overlapping occurrence count. All query tokens share one failure-automaton body pass.

      This is the simplest retrieval primitive — no index, no embeddings, no native deps. Useful when the agent already knows specific keywords; for frequency-weighted exact-token ranking use semanticSearch. Conceptual recall requires the embedding signal available through searchHybrid. Read concurrency is bounded to 16 to avoid blowing the fd limit on large vaults. Tokenization is whitespace-split + lowercased; case-insensitive.

      Parameters

      • vault: Vault

        The vault to search.

      • args: { folder?: string; limit?: number; mode?: SearchMode; query: string }

        Search arguments. query is required and must be non-empty. folder restricts the scan to a subdirectory (vault-relative). limit caps results (default 25). mode defaults to "all".

      Returns Promise<SearchResponse>

      A SearchResponse with sorted matches and a scanned_notes observability count.

      If query is empty / whitespace-only.

      If folder resolves outside the vault root.

      const result = await searchText(vault, {
      query: "RAG retrieval",
      folder: "Reference",
      mode: "all",
      limit: 10
      });
      for (const hit of result.matches) {
      console.log(`${hit.path}:${hit.line} — ${hit.snippet}`);
      }