enquire-mcp API reference - v4.0.0-rc.7
    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 contains only that key/value projection; it does not duplicate the complete map.

      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<KeyedFrontmatterResult>

      Full-map or keyed response. A missing keyed value is explicit null.

      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"
    • 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 contains only that key/value projection; it does not duplicate the complete map.

      Parameters

      • vault: Vault

        The vault to read from.

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

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

      Returns Promise<FullFrontmatterResult>

      Full-map or keyed response. A missing keyed value is explicit null.

      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"
    • 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 contains only that key/value projection; it does not duplicate the complete map.

      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<FullFrontmatterResult | KeyedFrontmatterResult>

      Full-map or keyed response. A missing keyed value is explicit null.

      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"