safari_mock_route
Intercept matching network requests to return a custom mock response, enabling testing of API error states, offline behavior, or replaced responses for both fetch and XHR.
Instructions
Intercept network requests matching a URL pattern and return a mock response. Works with both fetch and XHR. Useful for testing API error states, offline behavior, or replacing API responses.
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>",
"response": "<response>"
},
"name": "safari_mock_route"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| response | Yes | Mock response to return | |
| urlPattern | Yes | URL substring or regex pattern to match (e.g. '/api/users' or 'example\.com') |