Skip to main content
Glama

browser_fill

Fill controlled form inputs in React, Vue, or Svelte apps via CDP. Targets by CSS selector or semantic axis (text, regex, role, ariaLabel). Resolves to a single element; stops with clear errors on ambiguity or non-fillable targets.

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. 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.
Behavior5/5

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

With no annotations, the description fully discloses behavioral traits including CDP usage, controlled input handling, resolution logic, error codes (BrowserAmbiguousTarget, BrowserNoActionableTarget, BrowserFillNotDelivered), and the false-positive case for controlled input transforms. It also advises verifying actual value.

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?

The description is well-structured with bullet points and clear sections, front-loaded with main purpose, and every sentence adds value without being verbose.

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?

Given 11 parameters, no output schema, and no annotations, the description is thoroughly complete, covering targeting, error handling, usage, and caveats for all scenarios.

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 meaning beyond the schema: explaining how by-axis targeting works, mutual exclusivity with selector, role filtering, scope narrowing, case sensitivity, port default, and error handling. It also integrates with browser_overview/locate.

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 begins with 'Fill a form input with a value via CDP' and specifies it works on React/Vue/Svelte controlled inputs, clearly distinguishing it from sibling tools like browser_eval.

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 explicitly states when to use this tool over browser_eval and provides two targeting methods with clear caveats on ambiguity and error handling. It also notes the prerequisite of browser_open.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Harusame64/desktop-touch-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server