ios_safari_capture_network
Capture network requests made by a Safari page on an iOS device over a time window. Collects Network.requestWillBeSent, Network.responseReceived, Network.loadingFinished, and Network.loadingFailed events and returns merged records. Returns { records, bodiesOmitted? } in summary format, or a HAR 1.2 document when format="har". Each record: { requestId, method, url, requestHeaders?, status?, statusText?, mimeType?, resourceType?, responseHeaders?, encodedDataLength?, state, errorText?, startTimestamp?, endTimestamp?, body?, bodyTruncated?, bodyError? }. Set includeBodies=true to fetch response bodies for completed text-like responses (json|text|xml|javascript|html|css|svg|x-www-form-urlencoded); per-body cap: 10 000 chars (bodyTruncated=true when hit); total cap: 200 000 chars (excess records counted in bodiesOmitted). Body fetch failures set bodyError on that record. Set throttle to emulate bandwidth for the capture window only (best-effort; cleared afterwards): slow-3g (51 200 B/s) or fast-3g (209 715 B/s). NOTE: throttle="offline" is NOT supported on iOS — WebKit only has bandwidth throttling; use android_devtools_capture_network for offline. When throttle was active, a top-level throttle field appears in the output. Returns at most limit records (default 100, most-recent first) so heavy pages stay within the token budget — filter with urlSubstring / onlyErrors; total/returned appear when records were dropped. Default window: 5 000 ms. Maximum: 30 000 ms. Omit pageId to auto-pick the active page. Pass url to navigate inside the capture session and record the full page-load waterfall (pass the current URL to reload).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Navigate the page to this URL inside the capture session to record the full page-load waterfall (pass the current URL to reload) | |
| udid | Yes | iOS device UDID | |
| limit | No | Max records to return, most-recent first (default 100). Heavy pages make hundreds of requests; the default keeps the response within the MCP token budget. total/returned are included when records were dropped. | |
| format | No | Output format: "summary" (default) returns { records, bodiesOmitted? }; "har" returns a HAR 1.2 document | |
| pageId | No | CDP target id from ios_safari_list_pages. Omit it to use the page ios_safari_navigate last landed on (or, failing that, the first loaded page) — only pass it to target a DIFFERENT tab | |
| throttle | No | Emulate bandwidth for the capture window only (best-effort; cleared afterwards). slow-3g: 51 200 B/s. fast-3g: 209 715 B/s. offline is NOT supported on iOS — use android_devtools_capture_network instead. | |
| triggerJs | No | JavaScript run INSIDE the capture window (after the collector attaches) to trigger requests race-free — e.g. "fetch('/api/x')" or a click. For a full-page navigation prefer the `url` param. Both avoid the attach-race of triggering from a separate call. | |
| durationMs | No | Collection window in milliseconds (default: 5000, max: 30000) | |
| onlyErrors | No | Only failed / 5xx records | |
| urlSubstring | No | Only records whose URL contains this substring — target the requests you care about | |
| includeBodies | No | Fetch response body for completed text-like responses (default: true). Request bodies (postData) are always captured. Set false to skip response bodies for a lighter payload. Per-body cap: 10 000 chars. Total cap: 200 000 chars. | |
| platformVersion | No | Ignored (kept for compatibility) |