Tools · Files and code

download_file

Changes things

Download a file (binary-safe: zip, csv, image, pdf, …) from an http(s) URL to local disk.

When to use: Use this to save a file from a URL to disk. For reading a web page's text, use open_url instead.

Example

Run for real by scripts/tool-examples.py in a small demo project, with Haiku 5.5 where the tool calls a model. The output is exactly what the tool returned.

The call

tool call
{
  "tool": "download_file",
  "arguments": {
    "url": "https://example.com/",
    "path": "downloads/example.html"
  }
}

Real output

Downloaded 577 bytes → <project>/.shipit_workspace/downloads/downloads/example.html (text/html)

Parameters

NameTypeDescription
url*stringhttp(s) URL of the file
pathstringOptional destination filename or relative path (defaults to a name derived from the URL, saved in the downloads workspace).
overwritebooleanReplace an existing file

* required

Read, search and edit the project; run commands, code and git.