Skip to main content
Glama

browser_fill

Replaces text in one input, textarea, or contenteditable element and verifies the retained value, while rejecting Monaco/CM5 proxy textareas before focus or writes.

Instructions

Replace one ref/selector input/textarea/contenteditable and verify retained text. Known Monaco/CM5 proxy textareas are rejected before focus/writes. verification_basis identifies the expectation; verification_source identifies DOM value, selected text or innerText. Native contenteditable readback temporarily selects/reads plain text, then restores selection. CR/CRLF count as LF; requested spaces may retain NBSP. No editor model write, paste, blur or dropdown commit.

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": {
      "tab_handle": "<tab_handle>",
      "text": "<text>"
    },
    "name": "browser_fill"
  }
}

Input Schema

NameRequiredDescriptionDefault
nthNoZero-based match index.
refNo
modeNonative: focus/select and insert without character keydown. dom: write visible line breaks without focus, emit synthetic input/change.native
nameNoExact AX name; role only.
textYes
frameNoChild frame; see shared locator rules.
observeNoPost-action control read or snapshot diff; see shared observation rules.
frame_idNoSelector frame; default main.
selectorNoLocator query.
wait_forNoPost-action checks (same conditions as wait); shares the total action budget. Result is wait_result, never input replay.
tab_handleYes
timeout_msNoTotal action, wait and observation budget.
dialog_policyNoask
selector_typeNoDefault css.
expected_valueNoExpected retained text, default text. Verification only; insertion unchanged. No normalization or blur/async wait.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed13 schema fields changedv0.34.0
    • removedInput schema / properties / dialog_policy / description
      Removed value: -"accept/dismiss auto-handle dialogs and return their messages."
    • changedInput schema / properties / frame / description
      Previous value: -"Child frame: at least one of url/title/path. url/title exact; path=unique nested CSS iframe steps (e.g. [\"#frame\"]); exclusive with frame_id."New value: +"Child frame; see shared locator rules."
    • changedInput schema / properties / name / description
      Previous value: -"role only: exact AX name; empty allowed."New value: +"Exact AX name; role only."
    • changedInput schema / properties / nth / description
      Previous value: -"Selector only: zero-based DOM index, AX tree order for role."New value: +"Zero-based match index."
    • removedInput schema / properties / observe / additionalProperties
      Removed value: -false
    • addedInput schema / properties / observe / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "frame": {
      +        "additionalProperties": false,
      +        "description": "Child frame; see shared locator rules.",
      +        "properties": {
      +          "path": {
      +            "items": {
      +              "minLength": 1,
      +              "type": "string"
      +            },
      +            "maxItems": 16,
      +            "minItems": 1,
      +            "type": "array"
      +          },
      +          "title": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "url": {
      +            "minLength": 1,
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "frame_id": {
      +        "description": "Selector frame; default main.",
      +        "type": "string"
      +      },
      +      "max_chars": {
      +        "default": 16000,
      +        "maximum": 64000,
      +        "minimum": 1000,
      +        "type": "integer"
      +      },
      +      "max_options": {
      +        "default": 30,
      +        "maximum": 100,
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "name": {
      +        "description": "Exact AX name; role only.",
      +        "maxLength": 10000,
      +        "type": "string"
      +      },
      +      "nth": {
      +        "description": "Zero-based match index.",
      +        "maximum": 9007199254740991,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "popup_selector": {
      +        "description": "Unique CSS popup in control frame; default controls/owns relations or descendants.",
      +        "maxLength": 10000,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "ref": {
      +        "type": "string"
      +      },
      +      "selector": {
      +        "description": "Locator query.",
      +        "maxLength": 10000,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "selector_type": {
      +        "description": "Default css.",
      +        "enum": [
      +          "css",
      +          "xpath",
      +          "label",
      +          "placeholder",
      +          "role"
      +        ],
      +        "type": "string"
      +      },
      +      "timeout_ms": {
      +        "default": 1000,
      +        "maximum": 5000,
      +        "minimum": 100,
      +        "type": "integer"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "diff_since": {
      +        "maxLength": 128,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "max_chars": {
      +        "maximum": 2000000,
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "max_nodes": {
      +        "maximum": 3000,
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "timeout_ms": {
      +        "default": 5000,
      +        "maximum": 30000,
      +        "minimum": 100,
      +        "type": "integer"
      +      },
      +      "verbose": {
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "diff_since"
      +    ],
      +    "type": "object"
      +  }
      +]
    • changedInput schema / properties / observe / description
      Previous value: -"Read this explicit control after the action within its remaining budget; observation is separate from delivery. No assertion or automatic replay."New value: +"Post-action control read or snapshot diff; see shared observation rules."
    • removedInput schema / properties / observe / properties
      Removed value: -{
      -  "frame": {
      -    "additionalProperties": false,
      -    "description": "Child frame: at least one of url/title/path. url/title exact; path=unique nested CSS iframe steps (e.g. [\"#frame\"]); exclusive with frame_id.",
      -    "properties": {
      -      "path": {
      -        "items": {
      -          "minLength": 1,
      -          "type": "string"
      -        },
      -        "maxItems": 16,
      -        "minItems": 1,
      -        "type": "array"
      -      },
      -      "title": {
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "url": {
      -        "minLength": 1,
      -        "type": "string"
      -      }
      -    },
      -    "type": "object"
      -  },
      -  "frame_id": {
      -    "description": "Selector frame; default main.",
      -    "type": "string"
      -  },
      -  "max_chars": {
      -    "default": 16000,
      -    "maximum": 64000,
      -    "minimum": 1000,
      -    "type": "integer"
      -  },
      -  "max_options": {
      -    "default": 30,
      -    "maximum": 100,
      -    "minimum": 1,
      -    "type": "integer"
      -  },
      -  "name": {
      -    "description": "role only: exact AX name; empty allowed.",
      -    "maxLength": 10000,
      -    "type": "string"
      -  },
      -  "nth": {
      -    "description": "Selector only: zero-based DOM index, AX tree order for role.",
      -    "maximum": 9007199254740991,
      -    "minimum": 0,
      -    "type": "integer"
      -  },
      -  "popup_selector": {
      -    "description": "Optional unique CSS popup in the control frame; otherwise use browser-resolved controls/owns relations and control descendants.",
      -    "maxLength": 10000,
      -    "minLength": 1,
      -    "type": "string"
      -  },
      -  "ref": {
      -    "type": "string"
      -  },
      -  "selector": {
      -    "description": "Query by selector_type; role example: selector=\"link\", name=\"Claim\".",
      -    "maxLength": 10000,
      -    "minLength": 1,
      -    "type": "string"
      -  },
      -  "selector_type": {
      -    "description": "Default css. label: exact associated HTML label, whitespace normalized. placeholder: exact attribute.",
      -    "enum": [
      -      "css",
      -      "xpath",
      -      "label",
      -      "placeholder",
      -      "role"
      -    ],
      -    "type": "string"
      -  },
      -  "timeout_ms": {
      -    "default": 1000,
      -    "maximum": 5000,
      -    "minimum": 100,
      -    "type": "integer"
      -  }
      -}
    • removedInput schema / properties / observe / type
      Removed value: -"object"
    • changedInput schema / properties / selector / description
      Previous value: -"Query by selector_type; role example: selector=\"link\", name=\"Claim\"."New value: +"Locator query."
    • changedInput schema / properties / selector_type / description
      Previous value: -"Default css. label: exact associated HTML label, whitespace normalized. placeholder: exact attribute."New value: +"Default css."
    • changedInput schema / properties / timeout_ms / description
      Previous value: -"Total preparation/dispatch/verification and optional observation budget."New value: +"Total action, wait and observation budget."
    • addedInput schema / properties / wait_for
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Post-action checks (same conditions as wait); shares the total action budget. Result is wait_result, never input replay.",
      +  "properties": {
      +    "checks": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "condition": {
      +            "enum": [
      +              "attached",
      +              "absent",
      +              "visible",
      +              "actionable",
      +              "text",
      +              "value",
      +              "checked",
      +              "selected",
      +              "expanded",
      +              "url",
      +              "network_idle",
      +              "count",
      +              "value_present"
      +            ],
      +            "type": "string"
      +          },
      +          "expected": {
      +            "anyOf": [
      +              {
      +                "maxLength": 100000,
      +                "type": "string"
      +              },
      +              {
      +                "type": "boolean"
      +              },
      +              {
      +                "maximum": 9007199254740991,
      +                "minimum": 0,
      +                "type": "integer"
      +              }
      +            ],
      +            "description": "text/url: substring; value: exact; count: integer; states: boolean (checked also mixed)."
      +          },
      +          "frame": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "path": {
      +                "items": {
      +                  "minLength": 1,
      +                  "type": "string"
      +                },
      +                "maxItems": 16,
      +                "minItems": 1,
      +                "type": "array"
      +              },
      +              "title": {
      +                "minLength": 1,
      +                "type": "string"
      +              },
      +              "url": {
      +                "minLength": 1,
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "frame_id": {
      +            "type": "string"
      +          },
      +          "idle_ms": {
      +            "maximum": 10000,
      +            "minimum": 100,
      +            "type": "integer"
      +          },
      +          "name": {
      +            "maxLength": 10000,
      +            "type": "string"
      +          },
      +          "not": {
      +            "type": "boolean"
      +          },
      +          "nth": {
      +            "maximum": 9007199254740991,
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          "previous": {
      +            "description": "text: full prior innerText; exclusive with expected.",
      +            "maxLength": 100000,
      +            "type": "string"
      +          },
      +          "selector": {
      +            "maxLength": 10000,
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "selector_type": {
      +            "enum": [
      +              "css",
      +              "xpath",
      +              "label",
      +              "placeholder",
      +              "role"
      +            ],
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "condition"
      +        ],
      +        "type": "object"
      +      },
      +      "maxItems": 30,
      +      "minItems": 1,
      +      "type": "array"
      +    },
      +    "timeout_ms": {
      +      "default": 5000,
      +      "maximum": 30000,
      +      "minimum": 100,
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "checks"
      +  ],
      +  "type": "object"
      +}
  2. Changed2 schema fields changedv0.28.2
    • addedInput schema / properties / observe
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Read this explicit control after the action within its remaining budget; observation is separate from delivery. No assertion or automatic replay.",
      +  "properties": {
      +    "frame": {
      +      "additionalProperties": false,
      +      "description": "Child frame: at least one of url/title/path. url/title exact; path=unique nested CSS iframe steps (e.g. [\"#frame\"]); exclusive with frame_id.",
      +      "properties": {
      +        "path": {
      +          "items": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "maxItems": 16,
      +          "minItems": 1,
      +          "type": "array"
      +        },
      +        "title": {
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "url": {
      +          "minLength": 1,
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "frame_id": {
      +      "description": "Selector frame; default main.",
      +      "type": "string"
      +    },
      +    "max_chars": {
      +      "default": 16000,
      +      "maximum": 64000,
      +      "minimum": 1000,
      +      "type": "integer"
      +    },
      +    "max_options": {
      +      "default": 30,
      +      "maximum": 100,
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    "name": {
      +      "description": "role only: exact AX name; empty allowed.",
      +      "maxLength": 10000,
      +      "type": "string"
      +    },
      +    "nth": {
      +      "description": "Selector only: zero-based DOM index, AX tree order for role.",
      +      "maximum": 9007199254740991,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "popup_selector": {
      +      "description": "Optional unique CSS popup in the control frame; otherwise use browser-resolved controls/owns relations and control descendants.",
      +      "maxLength": 10000,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "ref": {
      +      "type": "string"
      +    },
      +    "selector": {
      +      "description": "Query by selector_type; role example: selector=\"link\", name=\"Claim\".",
      +      "maxLength": 10000,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "selector_type": {
      +      "description": "Default css. label: exact associated HTML label, whitespace normalized. placeholder: exact attribute.",
      +      "enum": [
      +        "css",
      +        "xpath",
      +        "label",
      +        "placeholder",
      +        "role"
      +      ],
      +      "type": "string"
      +    },
      +    "timeout_ms": {
      +      "default": 1000,
      +      "maximum": 5000,
      +      "minimum": 100,
      +      "type": "integer"
      +    }
      +  },
      +  "type": "object"
      +}
    • changedInput schema / properties / timeout_ms / description
      Previous value: -"Total preparation/dispatch/verification budget."New value: +"Total preparation/dispatch/verification and optional observation budget."
  3. Changed10 schema fields changedv0.24.2
    • changedInput schema / properties / dialog_policy / description
      Previous value: -"accept/dismiss returns handled dialog messages."New value: +"accept/dismiss auto-handle dialogs and return their messages."
    • changedInput schema / properties / expected_value / description
      Previous value: -"Explicit expected retained text after page formatting; default is text. Changes verification only, never the inserted text. No automatic numeric/date normalization or waiting for blur/async formatting."New value: +"Expected retained text, default text. Verification only; insertion unchanged. No normalization or blur/async wait."
    • changedInput schema / properties / frame / description
      Previous value: -"Exact child-frame URL/title or CSS iframe path (e.g. [\"#content_iframe\"]); alternative to frame_id. Each path entry uniquely selects an iframe in the preceding document."New value: +"Child frame: at least one of url/title/path. url/title exact; path=unique nested CSS iframe steps (e.g. [\"#frame\"]); exclusive with frame_id."
    • changedInput schema / properties / frame_id / description
      Previous value: -"Selector scope; defaults to main frame."New value: +"Selector frame; default main."
    • addedInput schema / properties / mode / description
      Added value: +"native: focus/select and insert without character keydown. dom: write visible line breaks without focus, emit synthetic input/change."
    • changedInput schema / properties / name / description
      Previous value: -"role only: exact accessible name; may be empty."New value: +"role only: exact AX name; empty allowed."
    • changedInput schema / properties / nth / description
      Previous value: -"Zero-based match index: DOM order, or AX tree order for role."New value: +"Selector only: zero-based DOM index, AX tree order for role."
    • changedInput schema / properties / selector / description
      Previous value: -"CSS/XPath query, HTML label text, exact placeholder or AX role (e.g. selector=\"link\", name=\"Claim\"), according to selector_type."New value: +"Query by selector_type; role example: selector=\"link\", name=\"Claim\"."
    • changedInput schema / properties / selector_type / description
      Previous value: -"Default css. label matches associated HTML labels with whitespace normalized; role uses browser AX semantics."New value: +"Default css. label: exact associated HTML label, whitespace normalized. placeholder: exact attribute."
    • changedInput schema / properties / timeout_ms / description
      Previous value: -"Covers preparation, dispatch and verification."New value: +"Total preparation/dispatch/verification budget."
  4. Changed1 schema field changedv0.24.1
    • changedInput schema / properties / selector / description
      Previous value: -"CSS/XPath query, HTML label text, exact placeholder or AX role, according to selector_type."New value: +"CSS/XPath query, HTML label text, exact placeholder or AX role (e.g. selector=\"link\", name=\"Claim\"), according to selector_type."
  5. First observedv0.24.0

TDQS

A3.6/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does substantial work: it discloses pre-write rejection of Monaco/CM5 proxy textareas, the contenteditable readback that temporarily selects text and then restores selection, LF normalization of CR/CRLF, NBSP retention for requested spaces, and the absence of model writes, paste, blur or dropdown commit. These are non-obvious side effects an agent could not get from the schema. It does not state failure behavior, retry semantics, or whether existing content is cleared beyond the single word 'Replace'.

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?

Six tight sentences, front-loaded with the core action and verification guarantee before the caveats. Each sentence carries distinct information — no filler or restatement of the title. Density is high, and undefined terms like 'verification_basis' cost some readability, but nothing is redundant.

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

Completeness3/5

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

For a 15-parameter tool with nested observe/wait_for/frame objects, no annotations and no output schema, the description covers the core fill-and-verify path but leaves significant surface unexplained. dialog_policy, which defaults to 'ask' and could block the action on a native dialog, is never mentioned, nor is wait_for or the mode distinction beyond what the schema says. Adequate for the happy path, incomplete for operational edge cases.

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 73%, so the baseline is 3, and the description adds only modest meaning on top: it clarifies that verification is separate from insertion ('verification_basis identifies the expectation; verification_source identifies DOM value, selected text or innerText'), which complements expected_value's schema note. The problem is that 'verification_basis' and 'verification_source' do not appear as schema properties, so the description references concepts the agent cannot map to inputs. The 15-parameter surface (observe, wait_for, dialog_policy, frame, mode) is otherwise untouched.

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 description opens with a specific verb and resource: 'Replace one ref/selector input/textarea/contenteditable and verify retained text', which immediately tells an agent this is a text-fill-with-verification tool. It also narrows scope by excluding 'paste, blur or dropdown commit', which implicitly separates it from select/paste siblings. It stops short of naming a sibling such as browser_type, so the boundary against the closest alternative is not spelled out.

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?

Usage is only implied: the reader must infer that this is the tool for setting text on a form control and confirming it stuck. Negative guidance is present ('Known Monaco/CM5 proxy textareas are rejected', 'No editor model write, paste, blur or dropdown commit'), which is genuinely useful. However, there is no explicit 'use this when..., use X instead when...' routing, so an agent choosing between browser_fill and browser_type gets no direct help.

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