Skip to main content
Glama

browser_fill

Clears a field and fills it with new text using a snapshot ref or CSS selector, triggering native input events; password-like fields return only the text length.

Instructions

Clear a field and replace its content. Prefer ref from browser_snapshot; selector still works. Uses native CDP Input.insertText, so the page's own input events fire. Returns the length only — never the text — when the field is a password or looks like a secret.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "browser_fill"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNoRef from the latest browser_snapshot, e.g. e12
textYesText to fill
selectorNoCSS selector for the input (use ref instead when you have one)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv4.5.0
    • addedInput schema / properties / ref
      Added value: +{
      +  "description": "Ref from the latest browser_snapshot, e.g. e12",
      +  "type": "string"
      +}
    • changedInput schema / properties / selector / description
      Previous value: -"CSS selector for input"New value: +"CSS selector for the input (use ref instead when you have one)"
    • changedInput schema / required
      Previous value: -[
      -  "selector",
      -  "text"
      -]New value: +[
      +  "text"
      +]
  2. First observedv2.0.4

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations present, the description carries the full burden and does well: it names the mechanism (native CDP Input.insertText), states that the page's own input events fire, and warns that only the length is returned for password or secret-looking fields. It stops short of covering failure modes (missing ref, hidden/non-focusable element) or whether focus is required, which keeps it from a 5.

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?

Three tight sentences, front-loaded with the action, then the parameter preference, then the mechanism and return-value caveat. No filler, and the security-relevant detail lands at the end where it is most likely to be read as a caveat.

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?

For a three-parameter mutation tool with no annotations and no output schema, the description covers purpose, mechanism, return value ('the length only'), and a security caveat. Missing only error/edge-case behavior such as what happens if the ref is stale or the element is not an input.

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

Parameters3/5

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

Schema coverage is 100%, so all three parameters are already documented in the schema, including the 'use ref instead when you have one' hint. The description's preference ordering for ref over selector reinforces but does not meaningfully extend what the schema provides, so baseline 3 applies.

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

Purpose4/5

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

The opening sentence states a concrete verb-plus-resource ('Clear a field and replace its content'), which an agent can immediately distinguish from browsing siblings like browser_click or browser_press. It does not explicitly contrast with other input-writing siblings (e.g. browser_select, browser_press), so sibling differentiation is only partial.

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

Usage Guidelines3/5

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

The description gives parameter-level guidance ('Prefer `ref` from browser_snapshot; `selector` still works') but never states when to use this tool versus alternatives such as browser_press or browser_select, nor any when-not conditions. Usage is implied by the fill-a-field purpose rather than spelled out.

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