Forms¶
Tools for <select> dropdowns, checkboxes, and file uploads. All return annotated screenshots so the next action has fresh element IDs.
select_option¶
Pick an option from a <select> dropdown by visible text or value.
Parameters
| Name | Type | Description |
|---|---|---|
element_id |
int |
The number label of the <select> element. |
option |
str |
The option to select — by visible text ("United States") or value attribute ("us"). |
Behavior
- Works with single-select and multi-select dropdowns.
- Native HTML
<select>only — not custom JS-rendered comboboxes. For those, click to open then click the option.
Example
→ select_option(7, "United States") # pick by visible text
→ select_option(7, "us") # pick by value attribute
check_checkbox¶
Toggle a checkbox by its Set of Marks number.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
element_id |
int |
— | The number label of the checkbox element. |
check |
bool |
True |
Set to True to check, False to uncheck. Idempotent — already-checked checkboxes stay checked if you pass True. |
Examples
→ check_checkbox(8) # ensure checkbox 8 is checked
→ check_checkbox(8, check=False) # uncheck checkbox 8
upload_file¶
Upload a file via the native browser file input.
Parameters
| Name | Type | Description |
|---|---|---|
element_id |
int |
The number label of the <input type="file"> element. |
file_path |
str |
Absolute path to the file on the local filesystem. |
Why this matters
Uses Playwright's set_input_files under the hood. This is the most reliable path through file uploads — works even when click-and-pick dialogs fail (which is most of the time, because MCP servers can't show native OS dialogs).
Examples
Use absolute paths
Relative paths are resolved against the MCP server's working directory, which may not be what you expect.
Multiple files
If the input has multiple, pass a comma-separated string of paths.
See also¶
- Interaction tools —
type_text,click - Upload a file guide — worked example