Skip to main content
Glama

get_file

Retrieve files from the Grok MCP server by providing a file ID to access stored documents, images, or media for processing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_idYes

Implementation Reference

  • The get_file tool handler which fetches file metadata from the XAI client.
    async def get_file(file_id: str):
        client = Client(api_key=XAI_API_KEY)
        file_info = client.files.get(file_id)
        client.close()
        
        return f"**File ID:** `{file_info.id}`\n**Filename:** {file_info.filename}\n**Size:** {file_info.size} bytes\n**Created:** {file_info.created_at}"

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