Skip to main content
Glama

chat_with_files

Ask questions or give instructions about uploaded files, using Grok to read and quote their contents.

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.
    show_usage: Append a token usage and cost footer to the reply (default False).

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNogrok-4.3
promptYes
sessionNo
file_idsYes
show_usageNo
system_promptNo
Behavior4/5

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

No annotations provided, so the description carries full burden. It discloses that file_ids are attached to the user turn, optional session persists history, and returns assistant reply with sources list. It does not mention auth or error handling, but covers key behaviors.

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 concise (9 lines), well-structured with general behavior, Args list, and Returns. Every sentence adds value; no redundancy.

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 6 parameters and no output schema, the description covers parameters and return value. Missing details like file type constraints or error conditions, but overall adequate.

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

Parameters5/5

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

Schema description coverage is 0%, but the description's Args section explains each parameter in detail (e.g., session path, default model, usage flag). This adds significant meaning beyond the schema's bare structure.

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 chats with Grok using uploaded files as context. The verb 'Chat' and resource 'files' are specific. It distinguishes from siblings like 'chat' (no files) and 'chat_with_vision' (vision-specific).

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 implies usage for file-based queries ('using one or more previously uploaded files as context'). However, it does not explicitly state when to use this vs. alternatives (e.g., 'chat' without files) or provide contraindications.

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