Skip to main content
Glama

delete_file

Remove files from the Grok MCP server to manage storage and maintain organization by specifying the file identifier.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_idYes

Implementation Reference

  • The delete_file tool handler that deletes a file from the XAI SDK by file_id. It creates a client, calls client.files.delete(), and returns a confirmation message with the deleted file ID.
    @mcp.tool() async def delete_file(file_id: str): client = Client(api_key=XAI_API_KEY) delete_response = client.files.delete(file_id) client.close() return f"Deleted file `{delete_response.id}`"
  • src/server.py:500-500 (registration)
    The @mcp.tool() decorator that registers the delete_file function as an MCP tool, making it available to the protocol.
    @mcp.tool()

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