Back to Genai Toolbox

cloud-storage-download-object

docs/en/integrations/cloud-storage/tools/cloud-storage-download-object.md

1.2.02.9 KB
Original Source

About

A cloud-storage-download-object tool streams a Cloud Storage object to a local file on the Toolbox server. Unlike cloud-storage-read-object, it does not return the object bytes to the LLM and does not require UTF-8 text content, so it can be used for binary objects or large files.

The destination path is interpreted on the server where Toolbox is running. Relative paths and paths containing .. are rejected.

Compatible Sources

{{< compatible-sources >}}

Requirements

The Cloud Storage credentials must be able to read the object. The Toolbox server process must also be able to create or overwrite the destination file. When overwrite is false, the tool returns an agent-fixable error if the destination already exists.

Parameters

parametertyperequireddescription
bucketstringtrueName of the Cloud Storage bucket containing the object.
objectstringtrueFull object name (path) within the bucket, e.g. path/to/file.txt.
destinationstringtrueAbsolute local filesystem path where the object will be written. Relative paths and paths containing .. are rejected.
overwritebooleanfalseIf true, overwrite the destination when it already exists. If false (default), return an error when it exists.

Example

yaml
kind: tool
name: download_object
type: cloud-storage-download-object
source: my-gcs-source
description: Use this tool to download a Cloud Storage object to the server filesystem.

Output Format

The tool returns a JSON object with:

fieldtypedescription
destinationstringLocal path where the object was written.
bytesintegerNumber of bytes written.
contentTypestringContent type recorded on the Cloud Storage object.

Reference

fieldtyperequireddescription
typestringtrueMust be "cloud-storage-download-object".
sourcestringtrueName of the Cloud Storage source to download objects from.
descriptionstringtrueDescription of the tool that is passed to the LLM.