enquire-mcp API reference - v3.9.0-rc.4
    Preparing search index...

    Function readNote

    • Read a single note, either full-body or as a document-map projection.

      The "map" format is the recommended preflight call when an agent wants to plan an edit but doesn't yet need the full body — it returns headings, frontmatter keys, and counts in a fraction of the tokens. Switch to "full" for the actual content.

      Resolves notes by exact path (path: "Sub/Note.md") or by title (title: "Note") — title resolution uses the same fuzzy-match path as wikilinks.

      Parameters

      • vault: Vault

        The vault to read from.

      • args: { format?: "map" | "full"; path?: string; title?: string }

        One of path or title is required. format defaults to "full".

      Returns Promise<NoteReadFull | NoteReadMap>

      Either a NoteReadFull or NoteReadMap depending on args.format. Use the format discriminator to narrow.

      If neither path nor title is provided, or the note cannot be resolved.

      If path resolves outside the vault.

      // Plan an edit — cheap, no body
      const map = await readNote(vault, { path: "Reference/Foo.md", format: "map" });
      console.log(map.headings); // → [{ level: 1, text: "Foo", line: 1 }, ...]

      // Fetch full body
      const full = await readNote(vault, { title: "Foo" });
      console.log(full.content);