Skip to main content
Glama

browser_form

Inspect form fields in a CSS-selector container to get names, types, values, labels, and states before filling, so you target the right input selectors.

Instructions

Inspect all form fields (input, select, textarea, button) within a CSS-selector-specified container and return their name, type, id, current value (withheld for a field the page masks, such as a password: value is null, valueWithheld is 'masked', and hasValue says whether it holds one), hint text, disabled/readOnly state, and associated label text (resolved via for[id], ancestor LABEL, aria-labelledby, aria-label in that order). Use this before browser_fill to discover exact field selectors and avoid accidentally targeting the wrong input (e.g. a global search bar). Caveats: Requires browser_open (CDP active). Hidden inputs (type=hidden) are excluded by default — set includeHidden:true if needed. Value text is truncated at 200 chars.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portNoChrome/Edge CDP remote debugging port (default 9222; configurable via desktop-touch-config.json)
tabIdNoTab ID from browser_open. Omit to use the first page tab.
includeNoOptional response-shape opt-in. `['envelope']` returns the self-documenting envelope (`_version` / `data` / `as_of` / `confidence`). `['raw']` forces raw shape (overrides DESKTOP_TOUCH_ENVELOPE=1 server default). Default behaviour is raw shape (compat with existing clients).
selectorYesCSS selector for the form or container element to inspect (e.g. '#login-form', '.search-bar'). All input, select, textarea, and button descendants are returned.
maxResultsNoMaximum number of form fields to return (default 100).
includeHiddenNoWhen true, include hidden inputs (type=hidden). Default false to avoid CSRF-token / serialized-state clutter.
includeContextNoWhen true (default), append `activeTab` + `readyState` lines to the response. Set false to skip — saves ~150 tokens per call when chaining several browser_* calls in the same tab.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv2.3.1
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / includeContext / description
      Previous value: -"When true, append activeTab and readyState context to the response."New value: +"When true (default), append `activeTab` + `readyState` lines to the response. Set false to skip — saves ~150 tokens per call when chaining several browser_* calls in the same tab."
    • changedInput schema / properties / port / description
      Previous value: -"Chrome/Edge CDP remote debugging port."New value: +"Chrome/Edge CDP remote debugging port (default 9222; configurable via desktop-touch-config.json)"
  2. Addedv1.12.0
  3. Removedv1.10.4
  4. Addedv1.9.2
  5. Removedv1.8.0
  6. Addedv1.6.0
  7. Removedv1.5.1
  8. Addedv1.5.0
  9. Removedv1.4.3
  10. Addedv1.4.2
  11. Removedv1.4.0
  12. Changed1 schema field changedv1.2.1
    • addedInput schema / properties / include
      Added value: +{
      +  "description": "Optional response-shape opt-in. `['envelope']` returns the self-documenting envelope (`_version` / `data` / `as_of` / `confidence`). `['raw']` forces raw shape (overrides DESKTOP_TOUCH_ENVELOPE=1 server default). Default behaviour is raw shape (compat with existing clients).",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  13. Addedv1.0.3

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 burden and delivers: masking semantics (value null, valueWithheld 'masked', hasValue), label resolution precedence (for[id] > ancestor LABEL > aria-labelledby > aria-label), hidden inputs excluded by default with an opt-in, and 200-char value truncation.

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?

Single dense paragraph, front-loaded with the action and return shape, then usage, then caveats — every sentence earns its place. It is long, but the length is justified by the return-field enumeration and required by the absence of an output schema.

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 a 7-parameter read tool with no annotations and no output schema, the description fully covers what is returned, the masking/truncation edge cases, the dependency, and the workflow position. Nothing needed to invoke it correctly is missing.

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; the description nonetheless adds value beyond the schema by explaining the masking fields and truncation behavior tied to the value output, plus the rationale for includeHidden. It does not extend the meaning of port, tabId, include, or maxResults.

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?

States a specific verb (inspect) and resource (form fields: input, select, textarea, button) scoped to a CSS-selector container, and enumerates the returned attributes. An agent can distinguish it from browser_fill, browser_locate, or browser_search without opening the 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?

Explicitly says to use it before browser_fill to discover exact field selectors and to avoid targeting the wrong input (naming a concrete failure mode, a global search bar). It also states the hard prerequisite (browser_open / CDP active).

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