request_upload_url
Returns a short-lived (5-minute) PUT URL plus a ready-to-run curl_example. An agent with shell access can run the curl_example directly to push the file to cloud storage, so the bytes never pass through its context window (a client without a shell can hand the command to its user). After the upload, pass upload_id and filename to chat to load the file and edit it in the same call (or call process_uploaded_document to load it alone). For files <100KB where token cost is trivial, upload_document_base64 still works inline. Max file size: 100 MB. Supported formats: .pdf, .docx, .txt, .rtf, .md, .html, .htm, .tex (plus .zip LaTeX project archives).
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": {
"filename": "<filename>",
"content_type": "<content_type>"
},
"name": "request_upload_url"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| purpose | No | What this file will be used for. 'document' = the active editable doc; 'attachment' = read-only AI-searchable reference; 'export-html' = HTML payload destined for /v1/documents/export (large-export upload flow, for documents above ~25 MB). | document |
| filename | Yes | Original filename including extension (e.g. 'contract.docx'). Used downstream for file-type detection. | |
| size_bytes | No | Optional file size in bytes, checked early when given. Must be > 0 and <= 104857600 (100 MB). | |
| content_type | Yes | MIME type the agent will PUT with (e.g. 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' for .docx). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| upload_id | Yes | ||
| expires_at | Yes | ||
| upload_url | Yes | ||
| curl_example | Yes | ||
| max_size_bytes | Yes | ||
| expires_in_seconds | Yes |