Skip to main content
Glama

chat_with_files

Ask questions about your uploaded files and get answers based on their contents. Use file IDs to attach context, with optional session history for persistent conversations.

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.3`).
    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.3
system_promptNo
Behavior4/5

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

No annotations, so description carries full burden. Discloses file attachment, session persistence, model selection, system prompt, and return format. Lacks details on potential destructive actions or rate limits, but covers core behavior.

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

Conciseness4/5

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

Reasonably concise, front-loaded with main action. Includes Args and Returns section. Could trim some redundancy, but overall well-structured.

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?

Given 5 params, 0% schema coverage, no output schema, and sibling count, description covers functionality, parameters, and return value. Missing error cases or prerequisites like needing to upload first, but still sufficiently complete.

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 coverage 0%, but description adds meaning to all 5 parameters: explains prompt as question, file_ids as IDs from upload_file, session for history persistence, model default, system_prompt prepended. Adequately compensates for schema gaps.

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?

Clearly states tool is for chatting about previously uploaded files with Grok. Distinct from siblings like 'chat' (no files) and 'chat_with_vision' (vision-specific). Specific verb+resource: chat using files as context.

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?

Implies usage when one has uploaded files to discuss. Doesn't explicitly exclude cases without files, but sibling 'chat' exists for that. Provides context on file_ids from upload_file, but no when-not-to-use guidance.

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