upload_file
Upload a local file (PDF, text) to xAI for use in future chats. Returns a file ID that can be passed to chat_with_files or grok_agent.
Instructions
Upload a local file to xAI so it can be attached to later chats.
Supported types include PDFs and text documents (see xAI file docs). The
returned file ID can be passed to `chat_with_files` or `grok_agent`.
Args:
file_path: Absolute or relative path to the local file.
Returns:
Markdown block with the assigned file ID, filename, and size.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes |