Skip to main content
Glama

browser_fill

Fills browser form inputs via CDP when normal value assignment fails, including React/Vue/Svelte controlled fields. Target by CSS selector or semantic axis, then verify the actual value.

Instructions

Fill a form input with a value via CDP — works on React/Vue/Svelte controlled inputs that reject browser_eval value assignment. Two ways to target: (1) selector — a CSS selector (use browser_overview / browser_locate to find one); or (2) by-axis (semantic) — by:'text'|'regex'|'role'|'ariaLabel' + pattern (e.g. by:'ariaLabel', pattern:'Email address', or by:'role', pattern:'textbox'), so you do not have to build a CSS selector. by-axis resolves to a SINGLE fillable element and STOPS with code:'BrowserAmbiguousTarget' (candidates[] + next[] hints) when 2+ match, or code:'BrowserNoActionableTarget' when the match is not a fillable input/textarea/contenteditable — it never guesses. Optionally add role to filter and scope to narrow. Provide EITHER selector OR by+pattern (not both). Use this over browser_eval when setting a controlled input's value via JS does not update framework state. Caveats: Requires browser_open (CDP active). actual in the response shows the element's value after fill; verify it matches the intended value (for a field the page masks, such as a password, neither the value you passed nor the one read back is echoed — valueWithheld:'masked' — and the match is still checked, in the page). Typed errors: code:'BrowserFillNotDelivered' on post-fill value mismatch — note the false-positive case where a React controlled input's onChange transforms the value (delivery actually succeeded; hints.verifyDelivery.subReason:'controlled_input_transform' for that case; the actual value is authoritative).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
byNoSemantic axis to target by INSTEAD of a CSS selector: 'text' (visible text), 'regex', 'role' (ARIA/implicit role), 'ariaLabel'. Pair with pattern. Resolves to a SINGLE actionable element and STOPS with candidates when ambiguous.
portNoChrome/Edge CDP remote debugging port.
roleNoOptional ARIA/implicit-role filter AND-combined with by (e.g. by:'text', pattern:'Save', role:'button').
scopeNoOptional CSS selector to limit the by-axis search scope (disambiguation).
tabIdNoTab ID from browser_open. Omit to use the first page tab.
valueYesText to fill into the input element
includeNoOptional response-shape opt-in. `['envelope']` returns the self-documenting envelope (`_version` / `data` / `as_of` / `confidence`). `['raw']` forces raw shape (overrides DESKTOP_TOUCH_ENVELOPE=1 server default). Default behaviour is raw shape (compat with existing clients).
patternNoValue matched against the chosen by axis (required when by is set).
selectorNoCSS selector for the input element. Provide EITHER selector OR by+pattern.
caseSensitiveNoCase-sensitive matching for by:'text'/'regex' (default false).
includeContextNoWhen true, append activeTab and readyState context to the response.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.12.0
  2. Removedv1.10.4
  3. Addedv1.9.2
  4. Removedv1.8.0
  5. Addedv1.6.0
  6. Removedv1.5.1
  7. Addedv1.5.0
  8. Removedv1.4.3
  9. Addedv1.4.2
  10. Removedv1.4.0
  11. Changed1 schema field changedv1.2.1
    • addedInput schema / properties / include
      Added value: +{
      +  "description": "Optional response-shape opt-in. `['envelope']` returns the self-documenting envelope (`_version` / `data` / `as_of` / `confidence`). `['raw']` forces raw shape (overrides DESKTOP_TOUCH_ENVELOPE=1 server default). Default behaviour is raw shape (compat with existing clients).",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  12. Addedv1.0.3

TDQS

A5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so thoroughly. It discloses CDP dependency, that it stops with specific error codes on ambiguous or non-actionable targets, that it never guesses, that actual value is verified and authoritative, that masked fields suppress echoing, and even the false-positive controlled-input transform case with subReason hints. No contradiction with structured fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

While long, every sentence earns its place. The structure is logical: purpose and use-case first, then targeting methods, then caveats and error handling. It front-loads the core intent and flows from selection to verification. No redundancy; the density is justified by the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 11 parameters, no output schema, and no annotations, the description is remarkably complete. It covers targeting options, disambiguation, error codes and hints, verification via 'actual' and 'valueWithheld', and the CDP prerequisite. The only minor omission is a full enumeration of all response fields, but the description highlights the critical ones. This is sufficient for an agent to invoke it correctly and interpret results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although schema coverage is 100%, the description adds substantial semantic depth beyond the schema: it explains the behavior of the 'by' axis resolution, the semantics of 'pattern' paired with 'by', the role and scope filters, and the error scenarios tied to parameters. For instance, it clarifies that 'by' must be paired with 'pattern' and that 'selector' is an exclusive alternative. This enriches understanding beyond field descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the exact action ('Fill a form input with a value via CDP') and explicitly differentiates from siblings by noting it works on controlled inputs that reject browser_eval assignment, and names browser_eval and browser_locate as alternatives. It also enumerates two distinct targeting methods, making its purpose unmistakable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides explicit guidance on when to use this tool over browser_eval ('Use this over browser_eval when setting a controlled input's value via JS does not update framework state'), and when to choose selector vs. by-axis ('by-axis resolves to a SINGLE fillable element...'), with a direct constraint: 'Provide EITHER selector OR by+pattern (not both).' It also warns about the CDP prerequisite (browser_open).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.