browser_route_intercept
Intercept network requests matching URL patterns to mock responses or simulate network failures via CDP Fetch, enabling controlled testing without backend changes.
Instructions
Intercept network requests matching a URL pattern to mock responses (status, body, headers) or emulate network failures via CDP Fetch domain.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "browser_route_intercept"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | Response body string or JSON to return | |
| action | No | Interception action: 'mock' (add mock rule), 'clear' (remove all mock rules and disable interception), 'list' (view active rules) | mock |
| headers | No | Optional HTTP response headers dict (e.g. {'content-type': 'application/json'}) | |
| status_code | No | HTTP status code to return when mocking (default 200) | |
| url_pattern | No | URL pattern to match (e.g. '*api/v1/users*', 'https://example.com/checkout*') | * |
| error_reason | No | Optional network error reason to fail request with (e.g. 'Failed', 'Aborted', 'ConnectionRefused', 'AccessDenied') |