network_stub
Intercept matching URLs through Fetch to fulfill or fail requests, replacing existing rules with the same URL pattern. Use with clear_network_stubs to remove stubs.
Instructions
Intercept matching URLs via Fetch and fulfill or fail them. Replaces a rule with the same urlPattern. Pair with clear_network_stubs.
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": "network_stub"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | ||
| action | Yes | ||
| status | No | ||
| headers | No | ||
| targetId | No | ||
| processId | No | Process ID. If omitted, uses the single running app. | |
| urlPattern | Yes | CDP urlPattern; * is a wildcard, e.g. "*api/users*" | |
| contentType | No | ||
| errorReason | No |