Skip to content
Kelly Ferrone edited this page Sep 12, 2026 · 6 revisions

resize

Resize the browser window.

MCP tool resize
HTTP POST /browser/resize

Use this when layout matters and the browser was opened for you, or when you need a different size partway through. The headless default is small and varies between Grid nodes, so set it explicitly before judging anything visual.

The new size sticks to the session, so a browser the Grid reaps and reopens comes back the size you last set rather than the size it was opened at.

Parameters

Name Type Required Default Notes
width integer no
height integer no
session_id string yes over HTTP The session_id returned by /browser/open. Required here.

Returns

Field Type Notes
width integer Window width now in effect.
height integer Window height now in effect.
url string Current URL after the action.
title string Page title after the action.

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.
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

resize()

HTTP

curl -X POST $SELENIUM_FLOW/browser/resize \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "session_id": "…"
  }'

← All actions · Installing · Deployment

Clone this wiki locally