net_intercept_add
Add a network intercept rule to block a request, mock a response, or modify request headers. Matches by URL substring; first match wins.
Instructions
Add a network intercept rule via CDP Fetch: block a request, mock its response, or modify its headers. Matches when urlPattern is a substring of the request url; the first matching rule wins. Enables interception lazily on first use.
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": {
"urlPattern": "<urlPattern>",
"action": "<action>"
},
"name": "net_intercept_add"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | mock: response body | |
| action | Yes | ||
| status | No | mock: response status code (default 200) | |
| sessionId | No | ||
| setHeaders | No | modify: headers to set/override on the outgoing request | |
| urlPattern | Yes | substring match against the request url | |
| contentType | No | mock: response content-type (default application/json) |