Skip to main content
Glama

browser_fill

Fill form inputs in React/Vue/Svelte controlled elements that reject JavaScript value assignment. Use CSS selectors or semantic targeting (by text, role, ariaLabel) to set values via Chrome DevTools Protocol.

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
selectorNoCSS selector for the input element. Provide EITHER selector OR by+pattern.
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.
patternNoValue matched against the chosen by axis (required when by is set).
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).
caseSensitiveNoCase-sensitive matching for by:'text'/'regex' (default false).
valueYesText to fill into the input element
tabIdNoTab ID from browser_open. Omit to use the first page tab.
portNoChrome/Edge CDP remote debugging port.
includeContextNoWhen true, append activeTab and readyState context to the response.
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).
Behavior5/5

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

With no annotations, the description fully discloses behavior: requires CDP (browser_open), resolves to a single element, stops with specific error codes (BrowserAmbiguousTarget, BrowserNoActionableTarget, BrowserFillNotDelivered), explains false-positive case (controlled_input_transform), and verifies actual value in response. This is comprehensive.

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

Conciseness4/5

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

Well-structured with front-loaded purpose and targeting methods, followed by caveats and errors. However, it is somewhat lengthy; some details (like the actual response field) could be shortened without losing meaning. Still, every sentence adds value.

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

Completeness4/5

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

Given no output schema and 11 parameters with conditional logic, the description covers targeting, error handling, preconditions (requires browser_open), and response fields. It is nearly complete but could mention behavior on invalid tabId or value length limit, though the schema handles maxLength.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description adds value beyond schema by explaining the by-axis targeting logic, disambiguation process, and how to use role and scope. It also clarifies the conditional requirement between selector and by+pattern. This justifies a 4.

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 clearly states 'Fill a form input with a value via CDP' and distinguishes it from browser_eval by specifying it works on controlled inputs. It also explains two targeting methods, making the purpose specific and unique among siblings.

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?

Explicitly says when to use (controlled inputs that reject browser_eval), how to target (selector vs by-axis with conditions), and gives caveats (ambiguous targets, false-positive errors). It also references browser_overview/browser_locate for finding selectors and mentions when not to use (provide EITHER selector OR by+pattern).

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