Skip to main content
Glama

detect_forms

Read-only

Identify all forms on a page and return their fields, locators, and attributes for automation. Include options, required status, and values when requested.

Instructions

Structured map of every on the page (plus a formless-controls group for SPAs) — against our real authenticated Chrome DOM. Each field carries a ready-to-use locator string (pipe straight into fill/click), plus type, name, label, required, options and checked/filled state. A free-text field's typed value is withheld unless values=true, and even then it's redacted when a type/name/autocomplete heuristic flags it as a password/credential/payment secret (best-effort — don't pass values=true on untrusted pages). Returns {forms, count}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
leaseNoOptional lease token to present if the target session is leased (0.7.0). Threaded per-call; never read from the server's env.
targetNoOptional @eN / @text: / CSS root to scope the walk to a subtree.
valuesNoInclude non-sensitive free-text field values (still redacts secrets).
sessionNoOptional session name to target (omit for the shared 'default'). On a daemon shared with other agents, pass a UNIQUE name for stateful multi-step work (go→click→fill) so you don't collide on 'default'.
max_charsNoCap each label/value length.
max_formsNoCap number of forms.
max_fieldsNoCap fields per form.
max_optionsNoCap options per <select>.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With only readOnlyHint and openWorldHint in the annotations, the description carries the behavioral burden and does it well. It discloses the SPA-specific formless-controls group, the value-withholding behavior unless values=true, secret redaction heuristics, the best-effort quality, and the security warning about untrusted pages, which goes far beyond the schema and annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is about 90 words across two sentences, front-loads the primary purpose, and each clause earns its place: the core return shape, the SPA extra, the field attributes, the value/redaction caveat, and the expected output shape. There is no fluff or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given there is no output schema, the description compensates by naming the return contract ({forms, count}) and the important per-field attributes. With all 8 parameters well-documented in the schema and 0 required, the only minor gap is a slightly more detailed shape of the form group under a formless-controls entry, but that is a small omission.

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 meaningful semantics on top: it explains that a free-text field's typed value is withheld unless values=true, describes the secret-redaction heuristic, and frames the output locators as ready for fill/click. This goes beyond trivial restatement of the schema.

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 names a specific verb and resource: it builds a structured map of every form on the page, including a formless-controls group for SPAs. It clearly distinguishes itself from siblings like extract, extract_fields, or candidates by emphasizing ready-to-use locators for fill/click and by mentioning the real authenticated Chrome DOM.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

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

The description gives strong usage direction: it presents locators as directly consumable by fill/click, and warns about when not to use values=true. It stops short of explicitly naming alternative tools or saying 'use X instead', so it lacks a formal when-not statement, but the context is largely clear.

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