Skip to main content
Glama

fill_form

Populate input, select, checkbox, radio, and textarea fields via CSS selectors or refs with React-compatible events; optionally submit and report values, mismatches, and page changes.

Instructions

Batch fill form fields with React-compatible events. Handles input, select, checkbox, radio, and textarea. Fields and submit take a CSS selector or a ref (n1, n2…) from navigate/get_interactives. With submit_selector it also submits, so a repeated call submits twice — not safe to retry blindly; after a submit, after_submit carries url, title and the text the page gained (the confirmation or the errors). Each field reports value_after and mismatch; page_changed carries the DOM delta, and the refs of what appeared.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldsYes{selector or ref, value or checked} per field
tab_idNoTarget tab; omitted = last tab navigated in this session, else the active one
frame_idNoTarget iframe id from get_frames; omitted = main frame
submit_refNoSubmit button as a ref, instead of submit_selector
wait_afterNoSettle before returning: navigation waits for a page load, networkidle for quiet trafficnone
submit_selectorNoSubmit button to click after filling

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv1.28.0
    • changedInput schema / properties / fields / description
      Previous value: -"{selector, value} pairs"New value: +"{selector or ref, value or checked} per field"
    • addedInput schema / properties / fields / items / properties / checked
      Added value: +{
      +  "description": "Checkbox/radio instead of value: true checks, false unchecks",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / fields / items / properties / ref
      Added value: +{
      +  "description": "From navigate or get_interactives, e.g. \"n3\"",
      +  "type": "string"
      +}
    • addedInput schema / properties / fields / items / properties / selector / description
      Added value: +"CSS selector; ignored when ref is given"
    • addedInput schema / properties / fields / items / properties / value / description
      Added value: +"Text, option value or label; for checkbox/radio \"true\"/\"false\""
    • removedInput schema / properties / fields / items / required
      Removed value: -[
      -  "selector",
      -  "value"
      -]
    • addedInput schema / properties / submit_ref
      Added value: +{
      +  "description": "Submit button as a ref, instead of submit_selector",
      +  "type": "string"
      +}
  2. Changed3 schema fields changedv1.10.0
    • addedInput schema / properties / frame_id / description
      Added value: +"Target iframe id from get_frames; omitted = main frame"
    • addedInput schema / properties / tab_id / description
      Added value: +"Target tab; omitted = last tab navigated in this session, else the active one"
    • addedInput schema / properties / wait_after / description
      Added value: +"Settle before returning: navigation waits for a page load, networkidle for quiet traffic"
  3. First observedv1.8.0

TDQS

A4.4/5.0
Behavior5/5

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

The description adds substantial behavior beyond the annotations: it warns that a repeated call with submit_selector submits twice and is not safe to retry blindly (consistent with idempotentHint=false), and it details post-submit/lateral reporting (after_submit url/title/gained text, per-field value_after and mismatch, page_changed DOM delta). This is exactly the operational detail annotations cannot convey.

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?

It is front-loaded with the core action and control-type coverage, then layers the selector/ref mechanic, the submit caveat, and reporting. It is dense but every sentence carries load; the return-value detail in the final clauses makes it slightly heavy for two sentences.

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?

There is no output schema, so the description correctly compensates by explaining what comes back (after_submit, value_after, mismatch, page_changed refs). For a 6-parameter, non-idempotent mutation tool, the agent has enough to call it safely.

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?

With 100% schema description coverage the baseline is 3, but the description adds cross-parameter meaning: it clarifies that fields and submit accept either a CSS selector or a ref from navigate/get_interactives, and ties the submit parameters to the double-submit consequence. This goes modestly beyond the per-parameter schema text.

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 gives a specific verb and resource ("Batch fill form fields with React-compatible events") and enumerates exactly which control types it covers (input, select, checkbox, radio, textarea). This clearly separates it from siblings like read_form (reading) and type_text (single-field typing) without opening any schema.

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 context is implied rather than explicit: it explains that refs come from navigate/get_interactives and that submit_selector triggers a submit, but never states when to prefer this tool over alternatives such as type_text, click, or read_form. The reader can infer the workflow but is not routed.

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