enquire-mcp API reference - v3.11.6-rc.2
    Preparing search index...

    Function frontmatterSearch

    • Find every note whose frontmatter matches a predicate.

      Useful as a precursor to bulk operations like frontmatterSet: "find all notes with status: draft and set their status to published", or "find notes whose aliases array contains a typo". Single predicate per call by design — combine with multiple calls if you need AND/OR logic.

      Parameters

      Returns Promise<
          {
              key: string;
              matches: { mtime: string; path: string; value: unknown }[];
              total_matches: number;
          },
      >

      { key, total_matches, matches }total_matches equals matches.length (counts the truncated result, not the full count).

      Trust boundary — in-process API that trusts its key length. The MCP boundary (obsidian_frontmatter_search in tool-registry.ts) caps key at MAX_FRONTMATTER_KEY_LEN (256, rc.13 AUD-04) so a remote bearer client cannot drive an unbounded multi-MB key through the whole-vault per-note nfcLower(key) fold; direct internal callers are not capped and must pass sane keys.

      If key is empty or the predicate count is not exactly 1.

      If folder resolves outside the vault.

      // Find every draft
      const drafts = await frontmatterSearch(vault, {
      key: "status",
      equals: "draft",
      limit: 50
      });

      // Find every note whose `aliases` array contains "RAG"
      const rag = await frontmatterSearch(vault, {
      key: "aliases",
      contains: "RAG"
      });