Capture response bodies to disk
capture_bodiesCapture matching network response bodies to disk the moment they arrive, before Chrome discards them. Preserves large or post-navigation responses for later retrieval, with metadata in capture.jsonl.
Instructions
Save every matching response body to disk the moment it arrives, in the background.
get_network_request asks Chrome for a body only when you ask — by then it is often gone: Chrome drops bodies over ~10 MB at once, and a navigation to another site drops the rest. This takes each body while the response is still paused, before the page even sees it, and writes it to a file.
Covers the whole browser until stopped: every tab, including ones the page opens itself, plus dedicated workers and service workers. Each body is its own file; capture.jsonl beside them records URL, method, POST data, status and headers per file. list_network_requests marks captured requests "saved", and get_network_request falls back to the file.
Not captured: responses from Chrome's cache (they never touch the network — reload with ignore_cache), redirects, and event streams inside workers. Event streams on a page are written as they arrive; every other matching response reaches the page only once complete, so keep the pattern off long-running downloads.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | "start" begins capturing in the background, "status" reports progress while it runs, "stop" ends it and reports what was saved. | start |
| browser | No | Which browser to act on. Each name is an independent Chrome, created on first use. Omit for the shared default; parallel agents each need their own name. | default |
| out_dir | No | Folder to write into, created if missing. Empty uses ~/.nodriver-mcp/captures/<timestamp>. | |
| max_body_mb | No | Skip a response whose Content-Length announces more than this many MB. A captured body is held in memory whole on its way to disk. | |
| url_pattern | No | Which responses to keep, matched against the full URL — required for start. "*" matches any run of characters and "?" exactly one, as in Chrome's own interception patterns: "*/api/*", "*graphql*". A pattern without "*" matches anywhere in the URL. "*" keeps everything. | |
| resource_types | No | Only these resource types, e.g. ["XHR", "Fetch"] for a page's own API calls. Omit for all. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |