download_file
Download a file from PostgresAI storage by full URL or relative path and save it locally; optionally specify organization ID and output path.
Instructions
Download a file from PostgresAI storage by URL (full URL under the storage base, or a relative path like /files/123/foo.png).
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": {
"url": "<url>"
},
"name": "download_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Full URL (must be under the configured storage base) or relative storage path (e.g. /files/123/foo.png) | |
| debug | No | Enable verbose debug logs | |
| org_id | No | Organization ID. Optional with a per-organization token (uses the stored org); REQUIRED with a global token, which can reach every organization the user belongs to and will not assume one. Use orgs_list / `pgai orgs` to discover valid values. | |
| output_path | No | Local destination path (default: derive filename from URL, save in CWD). When omitted, the path-traversal guard restricts the destination to CWD. |