export_to_onedrive (display name “OneDrive Upload”), the tool that uploads a file from a URL into the connected user’s personal OneDrive, inserting a new file or replacing an existing one. For SharePoint sites and document libraries, see the sibling tool export_to_sharepoint.
Choosing between OneDrive and SharePoint upload
The two upload tools are bound to different connectors (separate Azure AD apps), and the platform’s variable injection resolves exactly one connector per tool — so the choice is determined by where the file must go and which connector the workspace has:
If a workspace has only the OneDrive connector connected,
export_to_sharepoint cannot see it (and vice versa).
Authentication
Uses the OneDrive connector. The access token is injected by the platform — the tool never receives raw credentials as a per-run input. The tool registers only when OneDrive OAuth is configured. Outbound Microsoft Graph calls are audited.Enablement
Off by default — enable it in the agent’s Tools panel. This avoids offering two near-identical upload tools to every agent by default (see the disambiguation table above).Inputs
Required:file_url: URL of the file to upload — an S3 storage URL, a presigned URL, agenerate_file/python_codeoutput URL, or a signed download URL from a web automation result.file_name: Destination filename including extension (e.g.report.csv).
folder_path: Slash-separated folder path (e.g.Data/CSV). Missing folders are created automatically. Omitted = OneDrive root.conflict_behavior: What to do when a same-named file already exists in the folder:replace(default): overwrite in place — the existing drive item keeps its ID and version history, no duplicate is created.rename: keep both; the new file is saved asname 1.ext.fail: return an error and leave the existing file untouched.
mime_type: MIME type; auto-detected from thefile_nameextension when omitted.
Upload mechanics
- Files ≤ 4 MB upload with a single
PUT …:/contentrequest. - Larger files use a resumable Graph upload session with 10 MB chunks.
conflict_behavioris passed through on both paths (query parameter on the simple PUT, session body on the chunked path), so replace semantics hold at any file size.
Output
Structured result withfile_id, file_name, file_url (OneDrive web URL), mime_type, file_size, drive_id, folder_path, conflict_behavior, and completed_at, plus a markdown summary linking to the uploaded file.
Errors
- Missing/empty
file_urlorfile_name, or an unknownconflict_behaviorvalue, fail validation before any network call. - A
conflict_behavior: "fail"collision surfaces Microsoft Graph’snameAlreadyExistserror. - Download failures of
file_url(expired signed URL, wrong scheme) are returned as structured tool errors so the agent can retry or re-fetch the source.