network_add_mock
Intercept and mock network requests in a browser tab by defining URL patterns, HTTP methods, and custom response codes, headers, and bodies.
Instructions
Add a network mock rule that intercepts matching requests.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"targetId": "<targetId>",
"urlPattern": "<urlPattern>",
"responseCode": "<responseCode>"
},
"name": "network_add_mock"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | No | HTTP method to match (optional, matches all if omitted) | |
| targetId | Yes | Target ID of the tab | |
| urlPattern | Yes | URL pattern to match (supports * and ** glob wildcards) | |
| responseBody | No | Response body string | |
| responseCode | Yes | HTTP response code to return | |
| responseHeaders | No | Response headers as key-value pairs |