xai_upload_file
Upload a local file to xAI servers for attaching as reference in chats. Returns file ID, filename, size, and summary.
Instructions
Upload a local project file to xAI's servers so it can be reference-attached in chats.
Returns:
A dict with file_id (pass it to chat_with_files/xai_get_file_content),
filename, size_bytes, and a human-readable summary.
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": {
"file_path": "<file_path>"
},
"name": "xai_upload_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |