Skip to content

feat(webmcp): handle tool lifecycle events on modelContext - #478

Merged
beaufortfrancois merged 1 commit into
mainfrom
events
Sep 28, 2026
Merged

beaufortfrancois merged 1 commit into
mainfrom
events

Conversation

@beaufortfrancois

Copy link
Copy Markdown
Collaborator

Spec PR: webmachinelearning/webmcp#245

  • French Bistro: listen on document.modelContext when the implementation supports it, falling back to window otherwise.
  • Polyfill: add ontoolactivated/ontoolcancel handler properties to ModelContext, dispatch through a shared dispatchToolEvent() helper, and expose the two event constructors globally. toolName is now a readonly attribute instead of an expando on a plain Event.

Move the toolactivated/toolcancel events from the window to the
modelContext event target, and add the ToolActivatedEvent and
ToolCancelEvent interfaces to the polyfill as defined in
webmachinelearning/webmcp#245.

- Polyfill: add ontoolactivated/ontoolcancel handler properties to
  ModelContext, dispatch through a shared dispatchToolEvent() helper,
  and expose the two event constructors globally. toolName is now a
  readonly attribute instead of an expando on a plain Event.
- French Bistro: listen on document.modelContext when the
  implementation supports it, falling back to window otherwise.

@andreban andreban left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@beaufortfrancois
beaufortfrancois merged commit 0385e2c into main Sep 28, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants