delete_file
Remove files from the Grok MCP server to manage storage and maintain organization by specifying the file identifier.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_id | Yes |
Implementation Reference
- src/server.py:584-590 (handler)This is the MCP tool handler for 'delete_file', which uses the client to delete a file by its 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}`"