Experimental WebMCP tools: typed functions an in-browser AI agent can call
on a page that shows MAIDR charts.
Tracks the W3C Web Machine Learning Community Group draft at
https://webmachinelearning.github.io/webmcp/, which is still moving: the
entry point went from navigator.modelContext to document.modelContext,
and unregistration from unregisterTool(name) to an AbortSignal. Both
variants are detected here, and only here.
On by default, and a strict no-op wherever the browser has no WebMCP. The
reader turns it off with the general.agentTools setting, and a page author
with <meta name="maidr-webmcp" content="off">, which wins over the
setting. Nothing runs at import.
Three tools are exposed -- two silent reads and one cursor move that travels
the same path as window.maidrLive.navigateTo -- and nothing that writes
data, runs commands or changes settings.
Everything a tool returns is rebuilt from plain JSON types and capped, and
every string that came from the chart producer sits under content, since
a chart's title and labels are text an agent must not take as instructions.
The feature is contained in this file, its call site in
useMaidrController, the settings listener in Controller, the setting in
GeneralSettings and its row in the settings dialog; deleting those
removes it.
Experimental WebMCP tools: typed functions an in-browser AI agent can call on a page that shows MAIDR charts.
Tracks the W3C Web Machine Learning Community Group draft at https://webmachinelearning.github.io/webmcp/, which is still moving: the entry point went from
navigator.modelContexttodocument.modelContext, and unregistration fromunregisterTool(name)to anAbortSignal. Both variants are detected here, and only here.On by default, and a strict no-op wherever the browser has no WebMCP. The reader turns it off with the
general.agentToolssetting, and a page author with<meta name="maidr-webmcp" content="off">, which wins over the setting. Nothing runs at import. Three tools are exposed -- two silent reads and one cursor move that travels the same path aswindow.maidrLive.navigateTo-- and nothing that writes data, runs commands or changes settings.Everything a tool returns is rebuilt from plain JSON types and capped, and every string that came from the chart producer sits under
content, since a chart's title and labels are text an agent must not take as instructions.The feature is contained in this file, its call site in
useMaidrController, the settings listener inController, the setting inGeneralSettingsand its row in the settings dialog; deleting those removes it.