inject_latency
Adds artificial delay to specific requests to simulate slow networks and overloaded APIs, verifying loading indicators and graceful timeouts.
Instructions
Adds artificial delay to requests matching a URL pattern, simulating slow networks or overloaded APIs. Use to answer: does the app show loading states when the API takes 3 seconds? Does it time out gracefully?
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": {
"url": "<url>",
"intercept_pattern": "<intercept_pattern>"
},
"name": "inject_latency"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL of the page to test | |
| viewport | No | Viewport size (default: 1280×720) | |
| jitter_ms | No | Random additional delay in milliseconds (default: 0) | |
| latency_ms | No | Base delay in milliseconds to add to each matched request (default: 3000) | |
| loading_selector | No | CSS selector for the loading state that should appear (e.g., '.skeleton-loader') | |
| intercept_pattern | Yes | Glob pattern for requests to delay (e.g., '**/api/**') |