diff --git a/README.md b/README.md index fdadb95..7ccb8fe 100644 --- a/README.md +++ b/README.md @@ -411,7 +411,7 @@ As the WebMCP proposal continues to evolve with community and stakeholder feedba - **Output schema**: Supporting structured `outputSchema` contracts (complementing `inputSchema`) to help LLMs reliably reason about the return values of tools. See [Issue #9](https://github.com/webmachinelearning/webmcp/issues/9). -- **User prompting and elicitation**: Exploring a way for a tool to prompt the user for confirmation when tools require explicit user authorization. This could be done by delegating to the agent and its harness, or by invoking native browser permission dialogue outside of the agent loop. See [Issue #165](https://github.com/webmachinelearning/webmcp/issues/165) and [Issue #50](https://github.com/webmachinelearning/webmcp/issues/50) for discussion about the [`ModelContextClient`](https://webmachinelearning.github.io/webmcp/#modelcontextclient) interface. +- **User prompting and elicitation**: Exploring a way for a tool to prompt the user for confirmation when tools require explicit user authorization. This could be done by delegating to the agent and its harness, or by invoking native browser permission dialogue outside of the agent loop. See [Issue #165](https://github.com/webmachinelearning/webmcp/issues/165) and [Issue #50](https://github.com/webmachinelearning/webmcp/issues/50) for discussion about the `ModelContextClient` interface. - **Tool progress reporting**: For long-running tasks (e.g., batch processing or generating content), the agent may want a way to track a tool's progress. We are exploring how this intersects with the established [MCP Progress](https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/progress) specification. diff --git a/index.bs b/index.bs index f1bcd63..d3ab5f0 100644 --- a/index.bs +++ b/index.bs @@ -482,7 +482,7 @@ dictionary ToolAnnotations { boolean untrustedContentHint = false; }; -callback ToolExecuteCallback = Promise (object input, ModelContextClient client); +callback ToolExecuteCallback = Promise (object input);
@@ -510,7 +510,7 @@ callback ToolExecuteCallback = Promise (object input, ModelContextClient cl
tool["{{ModelContextTool/execute}}"]
-

A callback function that is invoked when an [=agent=] calls the tool. The function receives the input parameters and a {{ModelContextClient}} object. +

A callback function that is invoked when an [=agent=] calls the tool. The function receives the input parameters.

The function can be asynchronous and return a promise, in which case the [=agent=] will receive the result once the promise is resolved.

@@ -559,35 +559,6 @@ dictionary ModelContextRegisterToolOptions {
-

ModelContextClient Interface

- -The {{ModelContextClient}} interface represents an [=agent=] executing a tool provided by the site through the {{ModelContext}} API. - - -[Exposed=Window, SecureContext] -interface ModelContextClient { - Promise<any> requestUserInteraction(UserInteractionCallback callback); -}; - -callback UserInteractionCallback = Promise<any> (); - - -
-
client.{{ModelContextClient/requestUserInteraction(callback)}}
-
-

Asynchronously requests user input during the execution of a tool. - -

The callback function is invoked to perform the user interaction (e.g., showing a confirmation dialog), and the promise resolves with the result of the callback. -

-
- -
-The requestUserInteraction(callback) method steps are: - -1. TODO: fill this out. - -
-

Declarative WebMCP

This section is entirely a TODO. For now, refer to the [explainer draft](https://github.com/webmachinelearning/webmcp/pull/76).