Skip to content
Open
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
33 changes: 2 additions & 31 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ dictionary ToolAnnotations {
boolean untrustedContentHint = false;
};

callback ToolExecuteCallback = Promise<any> (object input, ModelContextClient client);
callback ToolExecuteCallback = Promise<any> (object input);
</xmp>

<dl class="domintro">
Expand Down Expand Up @@ -510,7 +510,7 @@ callback ToolExecuteCallback = Promise<any> (object input, ModelContextClient cl

<dt><code><var ignore>tool</var>["{{ModelContextTool/execute}}"]</code></dt>
<dd>
<p>A callback function that is invoked when an [=agent=] calls the tool. The function receives the input parameters and a {{ModelContextClient}} object.
<p>A callback function that is invoked when an [=agent=] calls the tool. The function receives the input parameters.

<p>The function can be asynchronous and return a promise, in which case the [=agent=] will receive the result once the promise is resolved.
</dd>
Expand Down Expand Up @@ -559,35 +559,6 @@ dictionary ModelContextRegisterToolOptions {
</dl>


<h4 id="model-context-client">ModelContextClient Interface</h4>

The {{ModelContextClient}} interface represents an [=agent=] executing a tool provided by the site through the {{ModelContext}} API.

<xmp class="idl">
[Exposed=Window, SecureContext]
interface ModelContextClient {
Promise<any> requestUserInteraction(UserInteractionCallback callback);
};

callback UserInteractionCallback = Promise<any> ();
</xmp>

<dl class="domintro">
<dt><code><var ignore>client</var>.{{ModelContextClient/requestUserInteraction(callback)}}</code></dt>
<dd>
<p>Asynchronously requests user input during the execution of a tool.

<p>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.
</dd>
</dl>

<div algorithm>
The <dfn method for=ModelContextClient>requestUserInteraction(<var ignore>callback</var>)</dfn> method steps are:

1. TODO: fill this out.

</div>

<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).
Expand Down
Loading