browser_save_file
Save a file from the page into the workspace's files and get its file_id (use it with messages.send attachment_file_ids or any files.* tool). The bytes move server-side, never through your context, so size is not a problem. source is one of: 'expression' — expression is JS that evaluates (promises are awaited) to a Blob/File, ArrayBuffer, typed array, Response, 'data:'/'blob:' URL or string, e.g. a recording kept in the page: 'window.__recordedBlob' or 'fetch("/export").then(r => r.blob())'; 'url' — url is fetched with this browser session's cookies (headers optional); 'download' — a download the page starts: pass ref to click the button that starts it, or omit ref to take the newest download the page already started (or wait for the next, up to timeout_ms). Optional filename and mime_type override what the page or server reports. Returns {file_id, name, mime, size}.
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": {
"page_id": "<page_id>",
"source": "<source>"
},
"name": "browser_save_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | ||
| url | No | ||
| frame | No | ||
| source | Yes | ||
| headers | No | ||
| page_id | Yes | ||
| filename | No | ||
| mime_type | No | ||
| expression | No | ||
| timeout_ms | No | ||
| in_workspace | No | Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected. |