You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chromium dispatches the event after invoking the callback. That way listeners see the tool's effects, for example a filled-in declarative form. It dispatches nothing if the callback detached the document.
Proposal: move the step after the call to execute, and add a guard:
1. Let |toolPromise| be the result of [=invoke|invoking=] |tool|'s {{ModelContextTool/execute}} with
|inputObject| and |options|.
+1. [=Fire an event=] named {{ModelContext/toolactivated}} at |targetDocument|'s [=Document/associated+ ModelContext|associated <code>ModelContext</code>=], using {{ToolActivatedEvent}}, with its+ {{ToolActivatedEvent/toolName}} attribute initialized to |tool|'s {{ModelContextTool/name}}.+
1. [=promise/React=] to |toolPromise|:
FYI I've discovered this issue when adding support for ToolActivatedEvent and ToolCancelEvent to the WebMCP polyfill in webmachinelearning/webmcp-polyfill#7
Activity
beaufortfrancois commentedon Oct 1, 2026
@domfarolino If that makes sense to you, I'll open a spec PR to fix this.
beaufortfrancois commentedon Oct 15, 2026
FYI I've discovered this issue when adding support for ToolActivatedEvent and ToolCancelEvent to the WebMCP polyfill in webmachinelearning/webmcp-polyfill#7