请求拦截 Mock
browser_mock_requestsIntercepts and mocks HTTP requests in the active tab by matching URL substrings and returning fake status, headers, or bodies. Simulates API responses, errors, and third-party stubs during testing.
Instructions
Intercept and mock HTTP requests of the active tab. Add or replace a rule that matches a URL substring (and optional method); matched requests are answered with a fake status/headers/body instead of reaching the network. Use to simulate API responses, error states, or stub third-party calls during testing. Pass action:"continue" to just observe (log) a matching request without answering it. Returns the rule id and current rules.
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": {
"urlContains": "<urlContains>"
},
"name": "browser_mock_requests"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | Fake response body text (default empty) | |
| tabId | No | Tab id (default: active tab) | |
| action | No | respond=answer with mock (default); continue=just pass through | |
| method | No | Only mock this HTTP method (e.g. GET/POST). Omit to match any. | |
| status | No | Fake response status code (default 200) | |
| headers | No | Fake response headers (optional) | |
| urlContains | Yes | Substring of request URL to match (case-insensitive), e.g. "/api/v1/quote" |