Capture a file download
downloadCapture a browser file save by arming before the trigger, then collect the resulting path and state.
Instructions
Capture a browser download: call action='arm' BEFORE triggering and require armed:true, trigger the download (click/navigate), then action='collect' for {state, path}. state 'in_progress' means the download started but has not finished: call collect again and do NOT trigger the download again. Arming again while your download is in progress, or after it finished but before collect, changes nothing and answers armed:false with a note that names the waiting file; collect is the next call. In browser_batch and in a recipe such an arm fails its step, so the trigger after it does not run. A finished result left uncollected for 330s is dropped by the next arm. Only one session can arm at a time; an abandoned arm expires after 330s, and a started download's capture expires 330s after the download began (collect calls do not extend it). Attribution is browser-wide, so keep the arm window short. Capture state survives service-worker restart within this browser session; if the worker restarts mid-wait, call collect again. Extension reload and browser restart clear capture state. The file lands in your browser's normal download folder.
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": {
"action": "<action>",
"tabId": "<tabId>"
},
"name": "download"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tabId | Yes | Target tab ID (must be in the MCP group) | |
| action | Yes | arm before triggering; collect after | |
| timeoutMs | No | collect: max wait in ms (default 30000, max 270000; Chrome terminates a worker when one request exceeds 5 minutes) |