Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"`:

Expand Down
9 changes: 5 additions & 4 deletions declarative-api-explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 3 additions & 3 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ A <dfn>tool definition</dfn> 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]]
Expand All @@ -185,7 +185,7 @@ A <dfn>tool definition</dfn> 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=].

Expand Down Expand Up @@ -1247,7 +1247,7 @@ dictionary RegisteredTool {

<h3 id="declarative-api">Declarative WebMCP</h3>

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).

<div algorithm>
The <dfn>synthesize a declarative JSON Schema object algorithm</dfn>, given a <{form}> element
Expand Down
Loading