Skip to main content
Glama

browser_form

Inspect form fields in any container via CSS selector to reveal their names, types, labels, values, and disabled states, enabling precise targeting before filling forms.

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.
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, append activeTab and readyState context to the response.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.12.0
  2. Removedv1.10.4
  3. Addedv1.9.2
  4. Removedv1.8.0
  5. Addedv1.6.0
  6. Removedv1.5.1
  7. Addedv1.5.0
  8. Removedv1.4.3
  9. Addedv1.4.2
  10. Removedv1.4.0
  11. 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"
      +}
  12. 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 provided, the description carries full responsibility for behavioral disclosure. It discloses the CDP prerequisite, the default exclusion of hidden inputs, the 200-char truncation, and the masking behavior (value null, valueWithheld 'masked', hasValue) with the exact resolution order for labels. This is thorough and leaves no critical behavior unexplained.

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?

The description is longer than minimal but every sentence adds essential context. It front-loads the core purpose and output details, then covers caveats. The structure flows logically from what the tool does, to how to use it, to behavioral notes. It could be slightly tightened (e.g., combining some caveats), but it is efficient and well-organized.

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?

Given the tool's complexity (7 parameters, no output schema), the description provides a complete picture: it explains the returned data structure (including edge cases like masked fields), the prerequisite, the default behavior for hidden inputs, and the label resolution order. An agent has everything needed to invoke it correctly and interpret results. No output schema exists, so the description's coverage of the response is essential and fully supplied.

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 adds value beyond the schema by explaining the semantics of includeHidden (why default false: to avoid CSRF-token clutter), the output shape (masking details), and the container concept for selector. However, it does not elaborate on port, tabId, or include's envelope behavior, though those are already well described in the schema. The added context justifies a 4.

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 states a precise verb ('Inspect'), a specific resource ('all form fields within a CSS-selector-specified container'), and enumerates the exact attributes returned. It also names the sibling tool it supports ('browser_fill') and the risk it mitigates (targeting the wrong input), making its purpose unambiguous and distinct from other browser tools.

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?

The description explicitly says 'Use this before browser_fill' and explains why (to discover exact field selectors and avoid accidental targeting). It also provides caveats: requires browser_open (CDP active), hidden inputs are excluded by default, and when to set includeHidden:true. This gives clear when-to-use guidance and a precondition, though it does not name alternatives beyond browser_fill.

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