browser_get_form
Extract form field details from web pages to identify input elements, their properties, and associated labels before automated form filling.
Instructions
Inspect all form fields (input, select, textarea, button) within a CSS-selector-specified container and return their name, type, id, current value, 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_input to discover exact field selectors and avoid accidentally targeting the wrong input (e.g. a global search bar). Caveats: Requires browser_connect (CDP active). Hidden inputs (type=hidden) are excluded by default — set includeHidden:true if needed. Value text is truncated at 200 chars.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector for the form or container element to inspect (e.g. '#login-form', '.search-bar'). All input, select, textarea, and button descendants are returned. | |
| includeHidden | No | When true, include hidden inputs (type=hidden). Default false to avoid CSRF-token / serialized-state clutter. | |
| maxResults | No | Maximum number of form fields to return (default 100). | |
| tabId | No | Tab ID from browser_connect. Omit to use the first page tab. | |
| port | No | Chrome/Edge CDP remote debugging port. | |
| includeContext | No | When true, append activeTab and readyState context to the response. |