Skip to main content
Glama

upload_file

Upload local files like PDFs and text documents to xAI for attachment in chats. Get a file ID to use with chat tools for file-based interactions.

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

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions supported file types (PDFs and text documents) and the return format, which adds useful context. However, it doesn't cover important behavioral aspects like authentication requirements, file size limits, error conditions, or rate limits that would be critical for a file upload operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly structured and front-loaded with the core purpose, followed by supported types, usage context, parameter explanation, and return format. Every sentence earns its place with no wasted words, making it highly efficient and readable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter tool with no annotations or output schema, the description provides good coverage of purpose, usage, parameters, and returns. However, it lacks details about error handling, file size limits, or authentication requirements that would be important for complete understanding of this mutation operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and only 1 parameter, the description fully compensates by clearly explaining the 'file_path' parameter as 'Absolute or relative path to the local file.' This provides essential semantic information that the schema lacks, though it doesn't specify path format examples or validation rules.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('upload a local file') and resource ('to xAI'), distinguishing it from sibling tools like 'delete_file' or 'list_files'. It explicitly mentions the purpose of enabling file attachment to later chats, providing a complete understanding of what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('to attach to later chats') and mentions specific sibling tools where the returned file ID can be used ('chat_with_files' or 'grok_agent'). However, it doesn't explicitly state when NOT to use it or compare it to alternatives like 'get_file' for retrieval.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/merterbak/Grok-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server