diff --git a/README.md b/README.md index 928bd7c..ee71a1e 100644 --- a/README.md +++ b/README.md @@ -311,12 +311,7 @@ The reason WebMCP is not limited to only declarative form tools is for the same ### Permissions policy and iframes -While much of this explainer assumes integration with built-in browser agents, WebMCP also supports **author-provided agents**, such as agents embedded directly on a page or running in an iframe, that can collaborate with parent frames and nested contexts. See: - - [Issue #57](https://github.com/webmachinelearning/webmcp/issues/57) - - [Issue #117](https://github.com/webmachinelearning/webmcp/issues/117) - - [Issue #159](https://github.com/webmachinelearning/webmcp/issues/159) - - [Issue #160](https://github.com/webmachinelearning/webmcp/issues/160) - - [Issue #178](https://github.com/webmachinelearning/webmcp/issues/178) +While much of this explainer assumes integration with built-in browser agents, WebMCP also supports **author-provided agents**, such as agents embedded directly on a page or running in an iframe, that can collaborate with parent frames and nested contexts. By default, WebMCP is enabled in top-level `Window`s and its same-origin iframes, but access can be delegated to cross-origin iframes using the [Permissions Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Permissions_Policy) `allow="tools"`: diff --git a/declarative-api-explainer.md b/declarative-api-explainer.md index edefb1c..4eccc20 100644 --- a/declarative-api-explainer.md +++ b/declarative-api-explainer.md @@ -206,7 +206,8 @@ It's an open question as to whether [an WebMCP tools, and therefore if the `agentResponse` Promise passed to `SubmitEvent#respondWith()` must resolve to an object conforming to such schema. -It is TBD how *declarative* WebMCP tools will be exposed to any interface that exposes a site's -tools to JavaScript. See https://github.com/webmachinelearning/webmcp/issues/51 for context. Should -a declarative WebMCP tool be able to be invoked from such an interface, should it exist in the -future? Almost certainly, yes. But details are TBD. +In-page agents can discover and run imperative tools with +[`getTools()`](https://webmachinelearning.github.io/webmcp/#dom-modelcontext-gettools) and +[`executeTool()`](https://webmachinelearning.github.io/webmcp/#dom-modelcontext-executetool). How +*declarative* tools show up there is still TBD. Should they be invokable from that interface? +Almost certainly, yes. But details are TBD. diff --git a/index.bs b/index.bs index 69bed7e..241bb2c 100644 --- a/index.bs +++ b/index.bs @@ -173,7 +173,7 @@ A tool definition is a [=struct=] with the following [=struct/items=] Note: For tools registered by the imperative form of this API (i.e., {{ModelContext/registerTool()}}), this is the stringified representation of {{ModelContextTool/inputSchema}}. For tools registered - [declaratively](https://github.com/webmachinelearning/webmcp/pull/76), this will be a + [declaratively](https://github.com/webmachinelearning/webmcp/blob/main/declarative-api-explainer.md), this will be a stringified JSON Schema object created by the [=synthesize a declarative JSON Schema object algorithm=]. [[!JSON-SCHEMA]] @@ -185,7 +185,7 @@ A tool definition is a [=struct=] with the following [=struct/items=] Note: For tools registered imperatively, these steps will simply invoke the [=imperative execute steps=]. For tools registered - [declaratively](https://github.com/webmachinelearning/webmcp/pull/76), this will be a set of + [declaratively](https://github.com/webmachinelearning/webmcp/blob/main/declarative-api-explainer.md), this will be a set of "internal" steps that have not been defined yet, that describe how to fill out a <{form}> and its [=form-associated elements=]. @@ -1247,7 +1247,7 @@ dictionary RegisteredTool {

Declarative WebMCP

-This section is entirely a TODO. For now, refer to the [explainer draft](https://github.com/webmachinelearning/webmcp/pull/76). +This section is entirely a TODO. For now, refer to the [Declarative API explainer](https://github.com/webmachinelearning/webmcp/blob/main/declarative-api-explainer.md).
The synthesize a declarative JSON Schema object algorithm, given a <{form}> element