Skip to main content
BAP defines 55 methods across 13 categories. All methods use JSON-RPC 2.0 request/response format over WebSocket.

Lifecycle (3)

Browser (2)

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | browser | "chromium" \| "firefox" \| "webkit" | "chromium" | Browser engine | | channel | string | — | Playwright channel (e.g., "chrome", "msedge") | | headless | boolean | true | Run in headless mode | | args | string[] | — | Additional browser arguments | | proxy | object | — | Proxy configuration | | downloadsPath | string | — | Directory for downloads | | userDataDir | string | — | Persistent user data directory | | cdpUrl | string | — | Connect to existing browser via CDP |

Page (8)

Actions (13)

All action methods accept a selector parameter using any of the 10 selector types.
| Parameter | Type | Description | |-----------|------|-------------| | pageId | string | Target page (defaults to active page) | | selector | BAPSelector | Element to interact with | | timeout | number | Operation timeout in ms |

Observations (7)

Storage (5)

Emulation (4)

Dialog, Tracing, Events (4)

Context (3)

Browser contexts provide isolated sessions with separate cookies and storage.

Frame (3)

Stream + Approval (2)

Discovery (1)

See the WebMCP guide for details on tool discovery.

Agent (3)

The agent methods are composite operations optimized for AI agent workflows. They batch multiple lower-level operations into single requests.
| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | steps | ExecutionStep[] | — | Sequence of steps to execute (1-50) | | pageId | string | active page | Target page | | stopOnFirstError | boolean | true | Halt on first failure | | timeout | number | — | Global timeout for entire sequence | | preObserve | AgentObserveParams | — | Run observe before steps (fusion) | | postObserve | AgentObserveParams | — | Run observe after steps (fusion) |
| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | includeAccessibility | boolean | — | Include full accessibility tree | | includeScreenshot | boolean | — | Include base64 screenshot | | includeInteractiveElements | boolean | — | Include interactive elements with refs | | maxElements | number | 50 | Max elements to return | | filterRoles | string[] | — | Filter to specific ARIA roles | | responseTier | "full" \| "interactive" \| "minimal" | "full" | Response compression tier | | incremental | boolean | — | Return only changes since last observation | | includeWebMCPTools | boolean | — | Discover WebMCP tools on the page | | annotateScreenshot | boolean \| AnnotationOptions | — | Add Set-of-Marks style annotation |
| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | instruction | string | — | Natural language description of what to extract | | schema | ExtractionSchema | — | JSON Schema defining the output structure | | mode | "single" \| "list" \| "table" | "single" | Extraction mode | | selector | BAPSelector | — | Limit extraction scope to a container | | includeSourceRefs | boolean | — | Include source element references |

Fusion Operations

Six optimizations that eliminate redundant roundtrips: