Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
Behavior2/5

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

No annotations provided, so description bears full burden. States upload action but lacks details on side effects (e.g., overwrite policy, size limits, authentication needs). Minimal behavioral context beyond the basic 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?

Extremely concise: a brief summary followed by structured Args and Returns sections. Every sentence adds value with no redundancy. Front-loaded with purpose.

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?

Covers essential aspects: purpose, parameter, return format, and downstream usage. Lacks error conditions or size constraints. With no output schema, return description is helpful. Missing explict mention of edge cases, but overall sufficient for core use.

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?

Schema has one parameter (file_path) with 0% schema description coverage. Description adds clarity: 'Absolute or relative path to the local file', distinguishing path type and confirming it is local, filling a significant gap.

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?

Description clearly states 'Upload a local file to xAI so it can be attached to later chats', specifying verb (upload), resource (local file), and purpose. Distinct from sibling file tools (e.g., get_file, delete_file) which handle different operations.

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?

Provides guidance on supported file types (PDFs, text documents) and directs the returned file ID to be used with chat_with_files or grok_agent. Does not explicitly mention when not to use this tool, but context is clear for its specific purpose.

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