Skip to main content
Glama

ui_fill

ui_fill

Fill a specified input field with a value by CSS selector or a selector from the current page state for browser automation and UI testing.

Instructions

Fill the single input element matching the given selector with a value. The selector may be a CSS selector or the selector value from ui_get_page_state, passed unchanged. Selectors containing "nth=" are positional: call ui_get_page_state again after the page changes before reusing them.

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": {
      "selector": "<selector>",
      "value": "<value>"
    },
    "name": "ui_fill"
  }
}

Input Schema

NameRequiredDescriptionDefault
valueYesThe value to fill into the input
selectorYesCSS selector, or the `selector` value of an input element from ui_get_page_state
session_idNoWhich open session to act on, as returned by ui_start_session. Optional with one open session; required when several are open.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden. It usefully discloses the staleness hazard of positional `nth=` selectors, which is real behavioral context. It stays silent on whether an existing value is replaced or appended, what happens when zero or multiple elements match, and whether an input event is dispatched.

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?

Three tight sentences, front-loaded with the primary action and followed by the selector-source rule and the staleness caveat. Minimal waste; the second sentence overlaps somewhat with the selector parameter's schema text.

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?

No annotations and no output schema, so the description must cover behavior on its own. It handles selector sourcing and staleness but leaves out the mutation semantics an agent needs to call it correctly — replacement of prior value, match-count failure modes, and whether a page-state refresh is required afterward.

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 the baseline is 3, and the description earns above that by explaining that the selector string from ui_get_page_state must be passed unchanged and by defining the positional meaning of `nth=` selectors. That positional semantics is not conveyed by the schema alone.

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?

States a specific verb and resource ("Fill the single input element matching the given selector with a value") and pins down the cardinality ("single"). It does not differentiate itself from closely related siblings such as ui_type or ui_select_option, so an agent must infer which of the fill/type family applies.

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 stated: the description tells the agent where to source the selector (CSS or the `selector` value from ui_get_page_state) and warns that `nth=` selectors must be refreshed after page changes. It gives no explicit when-to-use versus ui_type, nor any failure/precondition guidance.

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