write - kubed-io/selenium-flow GitHub Wiki

write

Type into an input, textarea or contenteditable, and read the value back so

MCP tool write
HTTP POST /browser/write

you can see it landed. clear (default true) replaces what is there; submit=true presses Enter afterwards.

To type a secret, pass secret={"name": ..., "key": ...} instead of text; secret://secrets lists them. The server types it and you never see it: value comes back null. A secret works only on the sites it allows, checked against the page you are on, so navigate there first.

Parameters

Name Type Required Default
text string no โ€”
selector Selector no โ€”
url string no โ€”
clear boolean no true
submit boolean no false
wait_timeout integer no 30
secret SecretRef no โ€”

Every call names its workspace: an X-Workspace header, or ?workspace=<name>. Sending both is refused. See Workspaces.

Returns

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.
site_data object Present only when site data was restored, skipped or forgotten in this call.
page object Present only when this browser was opened with capture=true and the page reported a failure while the call ran: what it caused, and where to read it.

Errors

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.
413 The body is over its cap: 1 MiB of JSON, 64 MiB of upload, 1 MiB of flow YAML. Send less; retrying it unchanged will fail again.
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.

Example

MCP

write()

HTTP

curl -X POST $SELENIUM_FLOW/browser/write \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Workspace: $WORKSPACE"

โ† All actions ยท Installing ยท Deployment

โš ๏ธ **GitHub.com Fallback** โš ๏ธ