Read, fetch, write, append, compress, decompress, and manage sharing for files
The File Parser tool provides a powerful way to extract and process content from various file formats, making it easy to incorporate document data into your agent workflows. This tool supports multiple file formats and can handle files up to 200MB in size.
With the File Parser, you can:
- Process multiple file formats: Extract text from PDFs, CSVs, Word documents (DOCX), text files, and more
- Handle large files: Process documents up to 200MB in size
- Parse files from URLs: Directly extract content from files hosted online by providing their URLs
- Process multiple files at once: Upload and parse several files in a single operation
- Extract structured data: Maintain formatting and structure from the original documents when possible
The File Parser tool is particularly useful for scenarios where your agents need to work with document content, such as analyzing reports, extracting data from spreadsheets, or processing text from various document sources. It simplifies the process of making document content available to your agents, allowing them to work with information stored in files just as easily as with direct text input.
Read workspace files by picker or canonical ID, fetch and parse files from URLs with optional headers, write new workspace files, append content to existing files, compress files into a .zip archive, extract a .zip archive into the workspace, or manage the public share link for a file.
Fetch and parse a file from a URL with optional custom headers.
| Parameter | Type | Required | Description |
|---|
headers | object | No | HTTP headers to include when fetching URL-based files. |
| Parameter | Type | Description |
|---|
files | file[] | Fetched files as UserFile objects |
combinedContent | string | Combined content of all fetched files |
| Parameter | Type | Required | Description |
|---|
fileId | string | No | Canonical workspace file ID, or an array of canonical workspace file IDs. |
fileInput | file | No | Selected workspace file object. |
| Parameter | Type | Description |
|---|
file | file | Workspace file object |
files | file[] | Workspace file objects |
Create a new workspace file. If a file with the same name already exists, a numeric suffix is added (e.g., "data (1).csv").
| Parameter | Type | Required | Description |
|---|
fileName | string | Yes | File name (e.g., "data.csv"). If a file with this name exists, a numeric suffix is added automatically. |
content | string | Yes | The text content to write to the file. |
contentType | string | No | MIME type for new files (e.g., "text/plain"). Auto-detected from file extension if omitted. |
| Parameter | Type | Description |
|---|
id | string | File ID |
name | string | File name |
size | number | File size in bytes |
url | string | URL to access the file |
Append content to an existing workspace file. The file must already exist. Content is added to the end of the file.
| Parameter | Type | Required | Description |
|---|
fileName | string | Yes | Name of an existing workspace file to append to. |
content | string | Yes | The text content to append to the file. |
| Parameter | Type | Description |
|---|
id | string | File ID |
name | string | File name |
size | number | File size in bytes |
url | string | URL to access the file |
Compress one or more workspace files into a single .zip archive stored in the workspace, for bundling files to download, transfer, or store.
| Parameter | Type | Required | Description |
|---|
fileId | string | No | Canonical workspace file ID, or an array of canonical workspace file IDs. |
fileInput | file | No | Selected workspace file object, or an array of file objects. |
archiveName | string | No | Name for the .zip archive (e.g., "documents.zip"). Defaults to the source file name when compressing a single file, otherwise "archive.zip". |
| Parameter | Type | Description |
|---|
id | string | Compressed archive file ID |
name | string | Compressed archive file name |
size | number | Compressed archive size in bytes |
url | string | URL to access the compressed archive |
files | file[] | Compressed archive file object, as a single-item array |
Extract the contents of a .zip archive into the workspace, preserving the archive folder structure.
| Parameter | Type | Required | Description |
|---|
fileId | string | No | Canonical workspace file ID of the .zip archive to extract. |
fileInput | file | No | Selected .zip archive file object. |
| Parameter | Type | Description |
|---|
files | file[] | Extracted workspace file objects |
Enable or disable the public share link for a workspace file, and set its access mode.
| Parameter | Type | Required | Description |
|---|
fileId | string | No | Canonical ID of the workspace file to update sharing for. |
fileInput | file | No | Selected workspace file object from the file picker. |
isActive | boolean | Yes | Whether the public link is enabled. Set false to make the file private. |
authType | string | No | Access mode for the link: public, password, email, or sso. |
password | string | No | Password to protect the link. Required when authType is password. |
allowedEmails | array | No | Allowed emails or @domain patterns for email or SSO access. |
| Parameter | Type | Description |
|---|
url | string | Public share URL for the file |
isActive | boolean | Whether the public link is enabled |
authType | string | Access mode: public, password, email, or sso |
hasPassword | boolean | Whether the share is password-protected |
allowedEmails | array | Allowed emails/domains for email or SSO access |