Skip to main content
Glama

fill

Set a form field in one verified call: click it, check focus, replace content with text, read the value back. Use instead of separate click, type, and screenshot steps.

Instructions

Set a form field in ONE verified call: click it, check the focus, replace its content with text, read the value back. Use it instead of click + type_text + screenshot for every field of a form.

Target the field with x,y (absolute pixels) or element (an id from parse_screen/ find_elements). Steps and what each can tell you:

  1. click, then a FOCUS CHECK before anything is typed — browsers through the page's DOM, native GTK/Qt/LibreOffice apps through the accessibility bus (AT-SPI). If the focus is not on an editable field, or is on a field whose rectangle does not contain the click (you clicked a label; the focus stayed where it was), the call FAILS with nothing typed and "focus" naming what has it. A password field is refused the same way unless allow_password=true — landing in one by accident is the case worth stopping.

  2. the old content is replaced (select-all, then type; text="" empties the field);

  3. the value is read back; submit=true presses Return only if nothing failed. Returns {"ok", "action", "instance", "detail", "method", "center", "focus_checked": "browser-dom"|"at-spi"|false, "focus"?: {role, name, rect}, "verified": true|false|null, "read_back": "browser-dom"|"clipboard"|"unreadable"|"skipped", "value"?, "click_effect"?: "changed"|"none", "suggest_element"?, "hit"?, "warnings"?}: focus_checked false — nobody could tell which widget had focus (canvas, game, Xlib-only app, iframe, or AT-SPI not installed: "focus_unchecked_reason"). The text was typed blind; "warnings" says so and "click_effect" reports whether the click changed any pixel near the target ("none" = probably a static label). Treat such a fill as UNCONFIRMED and screenshot. verified true — the focused field holds exactly text (trailing newline ignored); verified false — it holds something else ("value", first 200 chars): the field reformats or limits input (dates, phone masks, maxlength); verified null — the value could not be read (native password field, canvas). With element, a typed detector (ScreenParser) warns when the element is a text label and names the nearest input ("suggest_element"). Also fails (isError) when the field is still empty after typing; repeating fill() is always safe (it replaces). Native read-back goes through select-all + copy (the clipboard is restored). observe/settle_ms/ observe_region: see click().

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": "fill"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNo
yNo
textYes
submitNo
verifyNo
elementNo
observeNonone
instanceNo
settle_msNo
allow_passwordNo
observe_regionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.1

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so unusually well: it discloses the focus-verification mechanism per platform (browser DOM vs AT-SPI), the exact failure mode when focus lands on a label, the password refusal, the destructive-replace semantics ("select-all, then type"), the clipboard side effect and its restoration, and that it fails when the field is still empty. It even discloses the degraded path ("focus_checked false ... typed blind ... treat as UNCONFIRMED") rather than hiding it.

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 one-line action and then structured as numbered steps plus a keyed return-value list, so it is navigable despite its length. Every section is information-bearing, but the density is high and the return-value enumeration is long enough that it flirts with being a wall of text; a short lead-in labeling it as the return shape would tighten it.

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?

For an 11-parameter, no-annotation, no-output-schema mutation tool, this covers nearly everything an agent needs: targeting, the full step sequence, failure conditions, and an inline substitute for the missing output schema describing ok/verified/read_back/value/warnings. The residual gaps (verify toggle, instance) are minor relative to the total disclosure.

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 description coverage is 0%, so the description must supply all meaning, and it covers most of the 11 parameters: x/y as absolute pixels, element as an id from parse_screen/find_elements, text="" empties the field, submit=true presses Return only on success, allow_password gates password fields. However, `verify` (a boolean that presumably disables the read-back it spends three paragraphs describing), `instance`, and the enum values for `observe` are never explained, leaving real gaps at 0% coverage.

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 opening sentence names the specific verb and resource ("Set a form field") and immediately enumerates the internal sequence (click, focus check, replace, read back). It explicitly positions itself against the sibling composition "click + type_text + screenshot", so an agent can tell what it does and what it replaces without inspecting 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 Guidelines5/5

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

It states plainly when to use it: "Use it instead of click + type_text + screenshot for every field of a form." It also gives the inverse case — a password field is refused unless allow_password=true — and reassures that "repeating fill() is always safe (it replaces)". The only deferral is observe/settle_ms/observe_region to click(), which is an explicit pointer rather than an omission.

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