Skip to content

Commit 825f406

Browse files
committed
Clarify why imperative and declarative must exist
1 parent aed6af8 commit 825f406

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,12 @@ document.modelContext.registerTool({
281281

282282
For forms and standard HTML inputs, a declarative counterpart to the imperative API allows the browser to automatically synthesize tool definitions from `<form>` elements. This is detailed in the [Declarative API Explainer](./declarative-api-explainer.md). It will be soon folded into this explainer document.
283283

284+
We've gotten the following question a few times:
285+
286+
> why isn't declarative WebMCP sufficient on its own—why must there be an imperative counterpart?
287+
288+
The reason WebMCP is not limited to only declarative form tools is for the same reason that websites cannot be built exclusively out of declarative forms. Some of the web's functionality is only possible with JavaScript, and for WebMCP to represent the web's full functionality to agents, it must be able to expose that JavaScript functionality through imperative tools, not just declarative ones.
289+
284290
### Permissions policy and iframes
285291

286292
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:

0 commit comments

Comments
 (0)