-
Notifications
You must be signed in to change notification settings - Fork 0
write
Type text into an input, textarea or contenteditable.
| MCP tool | write |
| HTTP | POST /browser/write |
Set submit to press Enter afterwards, which fills and submits a search box in one call. Returns the field's value read back off the element, so you can confirm the text actually landed.
Address the field with EITHER xpath OR css, never both and never neither.
To type a secret, pass secret={"name": ..., "key": ...} instead of text. list_secrets shows what there is. You never see the value: the server reads it and types it, and the result comes back with value: null. A secret may only be used on the sites its owner allowed, checked against the page you are on, so navigate there first.
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
text |
string | no | — | |
xpath |
string | no | — | |
css |
string | no | — | |
session_id |
string | yes over HTTP | — | The session_id returned by /browser/open. Required here. |
url |
string | no | — | |
clear |
boolean | no | true |
|
submit |
boolean | no | false |
|
wait_timeout |
integer | no | 30 |
|
secret |
SecretRef | no | — |
| Field | Type | Notes |
|---|---|---|
value |
string | The field's value read back off the element, so a caller can confirm the text landed. Null for a write whose value came from a secret — that read is not performed at all, so the credential is never returned. |
text_from |
string | Present only when the value came from somewhere rather than being given: the kind of source it came from, never the value. |
url |
string | Current URL after the action. |
title |
string | Page title after the action. |
| Status | Means |
|---|---|
400 |
The request cannot succeed as sent — a missing field, a value that was rejected, or a locator that matched nothing before the wait ran out. Do not retry it unchanged. |
401 |
Missing or wrong bearer token. |
404 |
No such browser session. It ended, the Grid reaped it, or the id was never real. Open a new one and retry. |
500 |
Something failed that this server did not expect. |
503 |
The Grid could not serve this — unreachable, or no free slot for a new browser. Worth retrying after a wait. |
Over MCP the same failures arrive as a tool error.
MCP
write()
HTTP
curl -X POST $SELENIUM_FLOW/browser/write \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"session_id": "…"
}'The action pages are generated from openapi.yaml, which is itself generated from the live MCP tool schemas — so they describe the server that shipped, not the one someone remembered. Prose belongs in wiki-notes/<tool>.md in the repo.
selenium-flow · MIT
Start here
Guides
Lifecycle
Going places
Doing things
Getting things out