Skip to content

fix(browser_eval): align tool args with Playwright MCP 0.0.75 schema (target fields + fill_form)#141

Merged
gaojude merged 2 commits into
mainfrom
fix/browser-eval-playwright-target-fields
Jun 1, 2026
Merged

fix(browser_eval): align tool args with Playwright MCP 0.0.75 schema (target fields + fill_form)#141
gaojude merged 2 commits into
mainfrom
fix/browser-eval-playwright-target-fields

Conversation

@gaojude

@gaojude gaojude commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

What

@playwright/mcp@0.0.75 (current @latest, auto-installed by the browser_eval wrapper) renamed the locator field and changed the fill_form field shape. The wrapper forwarded the old names, so calls failed upstream with InputValidationError.

action old (sent) new (upstream 0.0.75)
browser_click ref target
browser_type ref target
browser_evaluate ref target
browser_drag startRef / endRef startTarget / endTarget
browser_fill_form { selector, value } { element?, target, name, type, value }

All names/shapes were verified against the live @playwright/mcp@0.0.75 server via an MCP tools/list introspection (not just docs). The fill_form field type is the enum textbox | checkbox | radio | combobox | slider.

How

  • Forward the new upstream names for click / type / evaluate / drag.
  • Rewrite the fill_form field schema to { element?, target, name, type, value } and map it through.
  • Keep ref / startRef / endRef and fields[].selector accepted as back-compat aliases (target = args.target ?? args.ref, f.target ?? f.selector), so existing callers don't break.

Verification

  • pnpm typecheckpnpm buildpnpm test ✅ (38/38)
  • Upstream schema confirmed live via tools/list against @playwright/mcp@0.0.75

Fixes #136

@playwright/mcp 0.0.75 (current @latest) renamed the locator field across
several tools, so the wrapper's old names fail upstream validation
(InputValidationError):

- browser_click / browser_type / browser_evaluate: ref -> target
- browser_drag: startRef/endRef -> startTarget/endTarget

Verified against the auto-generated tool docs in @playwright/mcp@0.0.75.
Adds target/startTarget/endTarget inputs and forwards the new names, while
keeping ref/startRef/endRef accepted as back-compat aliases
(target = args.target ?? args.ref).

Note: browser_fill_form's field-object shape also changed upstream but its
exact schema could not be verified from the package, so it is intentionally
left unchanged here.

Refs #136
…0.75

Verified against the live @playwright/mcp@0.0.75 browser_fill_form schema
(via tools/list): each field is now
  { element?, target (req), name (req), type (req: textbox|checkbox|radio|
    combobox|slider), value (req) }
replacing the old { selector, value }.

Update the user-facing schema and forward the new field names; accept
'selector' as a back-compat alias routed to 'target'
(target = f.target ?? f.selector). Completes the field-rename fix so
fill_form no longer fails upstream with InputValidationError.
@gaojude gaojude changed the title fix(browser_eval): map element refs to Playwright MCP 'target' fields fix(browser_eval): align tool args with Playwright MCP 0.0.75 schema (target fields + fill_form) Jun 1, 2026
@gaojude gaojude enabled auto-merge (squash) June 1, 2026 03:31
@gaojude gaojude merged commit 5393d2d into main Jun 1, 2026
4 checks passed
@gaojude gaojude deleted the fix/browser-eval-playwright-target-fields branch June 1, 2026 03:54
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.

browser_eval wrapper uses outdated field names: ref / startRef / endRef / selector — type, click, drag, evaluate, and fill_form all fail

2 participants