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

    Function frontmatterGet

    • Read a note's frontmatter — full map, or a single key's value.

      The read-only counterpart to frontmatterSet (write side). Use this before bulk-editing frontmatter so the agent can reason about current state before issuing a write. When key is set, the response includes the resolved value (which may be undefined if the key is absent).

      Parameters

      • vault: Vault

        The vault to read from.

      • args: { key?: string; path?: string; title?: string }

        One of path or title is required. key narrows the response to a single value.

      Returns Promise<{ frontmatter: Record<string, unknown>; path: string; value?: unknown }>

      { path, frontmatter, value? }value is only included when key is set.

      Trust boundary — this is an in-process API that trusts its key argument's length. The MCP boundary (obsidian_frontmatter_get 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 per-note lookupFoldedKey fold; direct internal callers are not capped and must pass sane keys.

      If the target can't be resolved.

      // Read all frontmatter
      const all = await frontmatterGet(vault, { path: "Posts/Article.md" });

      // Read a single key
      const just = await frontmatterGet(vault, {
      path: "Posts/Article.md",
      key: "status"
      });
      console.log(just.value); // → "draft"