save_file
Download any file type from a URL and save it locally. Returns the absolute path of the saved file for persisting crawl artifacts.
Instructions
Download a resource from a URL and save it to the local output directory. Handles any file type (images, PDFs, CSVs, etc.) via HTTP GET. Returns the absolute path of the saved file. Use to persist crawl artifacts; path traversal is blocked for security.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | No | Custom filename to save as (e.g. "report.pdf"). If omitted, derived from the URL's last path segment. Path traversal characters (../) are rejected. | |
| output_dir | No | Override the default output directory. Can be relative (resolved against CWD) or absolute. If omitted, uses the configured output_dir from settings. | |
| subdir | No | Subdirectory within the output directory to save into (e.g. "images", "data/csv"). Created automatically if it doesn't exist. | |
| url | Yes | Fully qualified URL of the resource to download (e.g. "https://example.com/report.pdf"). Must include protocol. |