get_request_initiator
Retrieve the JavaScript call stack that initiated a network request by its ID, helping trace the source code behind the request.
Instructions
Get the JS call stack that initiated a network request.
Returns a URL-matched hook stack as an investigation lead, not exact request attribution. Repeated/concurrent URLs can match a different invocation; corroborate with captured inputs. Requires inject_hook_preset("xhr"/"fetch") BEFORE navigating.
KNOWN LIMITATIONS (v0.8.1+):
For requests modified by an interceptor registered BEFORE MCP's hooks (e.g. SDKs loaded via sync ), the initiator will be the interceptor's call, not the original business code. Workaround: use instrumentation(action='reload').
For fetch on Firefox, Playwright-native initiator is often null. Requires inject_hook_preset('fetch', persistent=True).
Args: request_id: The ID of the request.
Returns: dict with url, initiator_stack, source, diagnostics and match_confidence. match_confidence is heuristic or unavailable; it never asserts exact identity.
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": {
"request_id": "<request_id>"
},
"name": "get_request_initiator"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request_id | Yes |