Skip to content

fix(webmcp): handle the breaking change to tool registration identity - #3540

Merged
seanmcguire12 merged 1 commit into
browserbase:external/vishalanton16-webmcp-tool-interfacefrom
vishalanton16:vishal/webmcp-tool-interface
Nov 24, 2026
Merged

seanmcguire12 merged 1 commit into
browserbase:external/vishalanton16-webmcp-tool-interfacefrom
vishalanton16:vishal/webmcp-tool-interface

Conversation

@vishalanton16

@vishalanton16 vishalanton16 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Why

A website can replace a tool and give the new tool the same name. If Stagehand calls a tool it found earlier using only that name, it can accidentally run the replacement. Chrome now gives each registration its own ID. WebMCP PR #348

What

Stagehand uses that ID in TypeScript and Python to call the exact tool it found. If the website has removed it, the call fails. Older Chrome versions still look up tools by name.

How

Verified on Chrome 158 and Chrome Dev 160 with both SDKs. On the WebMCP groceries demo, save the get_stores handle, navigate away, then return. On Chrome Dev 160, the saved handle should fail and a freshly discovered handle should return the stores.


Summary by cubic

Keeps saved WebMCP tool handles pointing at their original registration so a page that reuses a tool name can't redirect a previously discovered handle to a replacement tool. Chrome now assigns every registration a toolId; Stagehand passes it through in TypeScript and Python when Chrome supports it, and falls back to name-based lookup on older versions.

  • Adds optional toolId to tool descriptors, identities, and the protocol.
  • Invokes tools by toolId when available; old handles now fail cleanly if the registration was removed.
  • Emits a removal event when a registration is superseded by a same-named replacement.
  • Legacy clients can opt out of toolId in discovery and event payloads.
  • Bumps devtools-protocol to pick up the new WebMCP definitions.

Written for commit 2f51d59. Summary will update on new commits.

View guided diff

@changeset-bot

changeset-bot Bot commented Nov 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2f51d59

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@browserbasehq/stagehand Patch
@browserbasehq/stagehand-python Patch
@browserbasehq/stagehand-extension Patch
browse Patch
@browserbasehq/stagehand-examples Patch
@browserbasehq/stagehand-integrations-claude-cua-sdk Patch
@browserbasehq/stagehand-integrations Patch
@browserbasehq/eve Patch
@browserbasehq/stagehand-integrations-gemini-cua-sdk Patch
@browserbasehq/stagehand-integrations-example-pi-facade Patch
@browserbasehq/stagehand-integrations-claude-code Patch
@browserbasehq/stagehand-integrations-codex Patch
@browserbasehq/stagehand-integrations-cursor Patch
@browserbasehq/stagehand-integrations-deepagents-sdk Patch
@browserbasehq/stagehand-integrations-fx Patch
@browserbasehq/stagehand-integrations-mastra Patch
@browserbasehq/stagehand-integrations-pi-sdk Patch
@browserbasehq/stagehand-integrations-example-vercel-ai-facade Patch
@browserbasehq/stagehand-integrations-eve-harness Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run.
Approving the latest commit mirrors it into an internal PR owned by the approver.
If new commits are pushed later, the internal PR stays open but is marked stale until someone approves the latest external commit and refreshes it.

@github-actions github-actions Bot added external-contributor Tracks PRs mirrored from external contributor forks. external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. labels Nov 24, 2026
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​devtools-protocol@​0.0.1657692 ⏵ 0.0.1740066100 +110084 +598 +1100

View full report

@vishalanton16
vishalanton16 marked this pull request as ready for review November 24, 2026 15:02
@vishalanton16
vishalanton16 requested a review from a team as a code owner November 24, 2026 15:02
@seanmcguire12
seanmcguire12 changed the base branch from main to external/vishalanton16-webmcp-tool-interface November 24, 2026 19:46
@seanmcguire12
seanmcguire12 merged commit 2568de1 into browserbase:external/vishalanton16-webmcp-tool-interface Nov 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. external-contributor Tracks PRs mirrored from external contributor forks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants