Skip to content

Update WebMCP tool registration to be asynchronous#69720

Open
dgp1130 wants to merge 2 commits into
angular:mainfrom
dgp1130:webmcp-async
Open

Update WebMCP tool registration to be asynchronous#69720
dgp1130 wants to merge 2 commits into
angular:mainfrom
dgp1130:webmcp-async

Conversation

@dgp1130

@dgp1130 dgp1130 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

In the latest WebMCP specification and Chromium preview builds, document.modelContext.registerTool was updated to be asynchronous and return a Promise: https://groups.google.com/a/chromium.org/g/chrome-ai-dev-preview/c/xQWt0b1sZIE/m/UJznbNCIAwAJ?utm_medium=email&utm_source=footer

This commit update adjusts Angular's experimental WebMCP implementation (declareExperimentalWebMcpTool and form registration) to be async as well, returning Promise<void>.

Also removes unused unregisterTool as a separate cleanup.

@dgp1130 dgp1130 requested a review from alan-agius4 July 10, 2026 00:20
@dgp1130 dgp1130 added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Jul 10, 2026
@pullapprove pullapprove Bot requested a review from JeanMeche July 10, 2026 00:21
@angular-robot angular-robot Bot added the area: core Issues related to the framework runtime label Jul 10, 2026
@ngbot ngbot Bot added this to the Backlog milestone Jul 10, 2026
dgp1130 added 2 commits July 10, 2026 00:35
In the latest WebMCP specification and Chromium preview builds, `document.modelContext.registerTool` was updated to be asynchronous and return a `Promise`: https://groups.google.com/a/chromium.org/g/chrome-ai-dev-preview/c/xQWt0b1sZIE/m/UJznbNCIAwAJ?utm_medium=email&utm_source=footer

This commit update adjusts Angular's experimental WebMCP implementation (`declareExperimentalWebMcpTool` and form registration) to be async as well, returning `Promise<void>`.
In the WebMCP specification, tools are unregistered by aborting the `AbortSignal` provided in `registerTool(tool, {signal})`. The deprecated `unregisterTool` method on `ModelContext` is no longer needed or part of the standard, and is now removed from the TypeScript interface definition.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant