MAIDR JavaScript API
    Preparing search index...

    Function acquireWebMcpTools

    • Exposes the page's charts to in-browser AI agents as WebMCP tools, for as long as the returned handle is held.

      Every mounted chart holds one; the tools are registered once, by the first mount that finds them enabled and no other copy of MAIDR providing them, and serve every chart in the registry. They are removed a tick after the last handle is disposed, so a remount in the same tick -- React StrictMode, an adapter re-initialising -- does not churn them.

      Experimental, and a strict no-op unless the reader's general.agentTools setting allows it (the default), the page does not carry <meta name="maidr-webmcp" content="off">, it is a secure context, and it runs in a browser that has document.modelContext (or the deprecated navigator.modelContext). See docs/WEBMCP.md.

      Parameters

      Returns Disposable

      A handle whose dispose releases this chart's hold; calling it more than once does nothing