Intercept network
network_mockAdd, list, or remove per-tab request interception rules to block matching calls, return fake responses, or rewrite headers during browser sessions.
Instructions
Adds, lists or removes interception rules for the tab: block matching requests, answer them with a fake response, or rewrite request headers. Rules are removed when the session ends.
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": {
"action": "<action>"
},
"name": "network_mock"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Rule id (action remove). | |
| block | No | Fail matching requests (action add). | |
| tabId | No | Tab to act on. Defaults to the session target tab (see tab_select). | |
| action | Yes | What to do. | |
| method | No | Only this HTTP method. | |
| respond | No | Answer matching requests with this fake response (action add). | |
| setHeaders | No | Request headers to add or override. | |
| urlPattern | No | Glob pattern for request URLs, "*" matches anything (action add). | |
| resourceType | No | Only this resource type, e.g. "XHR", "Fetch", "Image". |