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

    Function validateNoteProposal

    • Pre-write validator — lint an LLM-proposed note against the live vault before writing.

      The "anti-slop" first call: the LLM proposes a draft, this validator checks YAML / wikilinks / tags / path-collision against the vault, and returns structured errors[] + warnings[]. The LLM can fix-and-retry via the same call, finally invoking createNote / appendToNote only after the validator reports ok: true. Read-only — never mutates disk. Always returns a structured result for ANY input, even malformed — path-traversal errors become kind: "path-traversal" errors rather than exceptions.

      v3.7.16 P2-14 — errors[] now includes path-excluded when the proposed destination is blocked by --exclude-glob / --read-paths. Pre-3.7.16 the validator passed structurally-valid proposals into excluded destinations; the actual write would then fail at runtime. Pre-write parity with writeNote / createNote is the new contract.

      Parameters

      Returns Promise<ValidateProposalResult>

      A ValidateProposalResult with ok, errors, warnings, YAML parse status, per-wikilink resolution, tag classification, and collision detection. Possible errors[].kind values include path-traversal, path-excluded (v3.7.16+), yaml-invalid, plus the wikilink / tag / collision categories.

      const v = await validateNoteProposal(vault, {
      path: "Inbox/draft.md",
      content: "---\nstatus: draft\n---\n# Title\n\n[[Bar]] is broken.",
      mode: "create"
      });
      if (!v.ok) {
      for (const e of v.errors) console.error(e.kind, e.message);
      }