Skip to main content
Glama

chat_with_files

Ask questions about uploaded files to get AI-powered answers with cited sources from their content.

Instructions

Chat with Grok using one or more previously uploaded files as context.

Attaches the given `file_ids` to the user turn so Grok can read/quote their
contents. Optional `session` persists local chat history across calls.

Args:
    prompt: Question or instruction about the attached files.
    file_ids: IDs of files previously returned by `upload_file`.
    session: Optional session name for persistent history in `chats/{session}.json`.
    model: Grok model id (default `grok-4-1-fast-reasoning`).
    system_prompt: Optional system instruction prepended to the conversation.

Returns:
    Assistant reply, followed by a `**Sources:**` list when the model cites URLs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYes
file_idsYes
sessionNo
modelNogrok-4-1-fast-reasoning
system_promptNo
Behavior4/5

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

With no annotations provided, the description carries full burden and does well. It explains that files are attached so Grok can 'read/quote their contents,' describes session persistence in 'chats/{session}.json,' and specifies the return format with '**Sources:**' list for citations. It doesn't mention rate limits or auth needs, but covers key behavioral aspects.

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 well-structured and appropriately sized. It starts with the core purpose, then details parameters in a clear 'Args:' section, and ends with return behavior. Every sentence adds value without redundancy, making it easy to scan and understand.

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 tool with 5 parameters, no annotations, and no output schema, the description is quite complete. It explains purpose, parameters, and return format. The main gap is lack of explicit error cases or limitations, but it covers the essential context needed for effective 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 description coverage is 0%, so the description must compensate. It adds meaningful context for all 5 parameters: 'prompt' is a 'Question or instruction about the attached files,' 'file_ids' come from 'upload_file,' 'session' provides 'persistent history,' 'model' has a default, and 'system_prompt' is 'prepended to the conversation.' This goes beyond schema titles, though some details like model options aren't specified.

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 tool's purpose: 'Chat with Grok using one or more previously uploaded files as context.' It specifies the verb ('Chat'), resource ('Grok'), and key constraint ('using previously uploaded files'), distinguishing it from sibling tools like 'chat' (no files) and 'chat_with_vision' (vision-based).

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: when you have files uploaded via 'upload_file' and want to ask questions about them. It mentions the 'session' parameter for persistent history, giving usage guidance. However, it doesn't explicitly contrast with alternatives like 'chat_with_vision' or state when not to use it.

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