detect_forms
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
| Name | Required | Description | Default |
|---|---|---|---|
| lease | No | Optional lease token to present if the target session is leased (0.7.0). Threaded per-call; never read from the server's env. | |
| target | No | Optional @eN / @text: / CSS root to scope the walk to a subtree. | |
| values | No | Include non-sensitive free-text field values (still redacts secrets). | |
| session | No | Optional 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_chars | No | Cap each label/value length. | |
| max_forms | No | Cap number of forms. | |
| max_fields | No | Cap fields per form. | |
| max_options | No | Cap options per <select>. |