network_stub
Intercepts matching URLs via Fetch and fulfills or fails them to mock network responses, replacing any rule with the same URL pattern.
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 |