Repository navigation
Conversation
The WebMCP spec now declares executeTool(tool, optional object inputObject),
and Chromium 155 rejects the JSON string the page bridge was passing
("invalid input object: value is not an object"). Every page tool call
failed before reaching the tool, surfacing as "WebMCP tool execution failed".
The bridge now passes the arguments object. If an older DOMString-era
ModelContext rejects it with UnknownError before the callback activates,
it retries once with the JSON string, so no tool runs twice. The polyfill
accepts both forms.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
gil--
force-pushed
the
fix/executetool-object-input
branch
from
October 16, 2026 17:22
c52458e to
9ede67b
Compare
gil--
marked this pull request as ready for review
October 16, 2026 17:22
Owner
|
Dupe of #19, closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every page tool call fails with
WebMCP tool execution failedon Chrome 155. The WebMCP spec now declares the input as an object:Promise<DOMString> executeTool(RegisteredTool tool, optional object inputObject, optional ModelContextExecuteToolOptions options = {});The page bridge still passes
JSON.stringify(args). Chrome 155's nativeModelContextrejects that string before the tool runs:The lifecycle replaces the page's error text with fixed text, so the agent sees only the generic message, about 2 ms after the call.
Fix
page-bridge.jspasses the arguments object.ModelContextbuilds turn an object into"[object Object]"and reject withUnknownErrorbefore the callback runs. On that rejection, if notoolactivatedevent fired for the tool, the bridge retries once with the JSON string. A tool whose callback already ran is never retried.webmcp-polyfill.jsaccepts the object form (cloned through JSON,undefinedbecomes{}) and still accepts a JSON string from older callers.Testing
pnpm run check: typecheck, lint, 67 files / 973 tests pass. New tests cover the object input in the polyfill, the legacy string retry, and no retry after the callback activated.document.modelContext, no flags) on a live Shopify storefront, callingsearch_catalogwith{ catalog: { query: "sticker" } }through the page bridge:{"error":{"code":-32000,"message":"Tool execution failed"}}I did not run the WPT browser suite (
test:browser:webmcp-wpt).🤖 Generated with Claude Code