Skip to main content
Glama
snilld-ai
by snilld-ai

delete-file

Remove files from OpenAI Assistant storage by specifying their unique file ID to manage storage and maintain organized assistant resources.

Instructions

Delete a file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_idYesThe ID of the file to delete

Implementation Reference

  • The MCP tool handler for 'delete-file' that extracts the file_id argument and delegates to the LLMConnector's delete_file method, returning a formatted response.
    elif name == "delete-file": file_id = arguments["file_id"] response = await connector.delete_file(file_id) return [types.TextContent(type="text", text=f"File deleted: {response.id}, status: {'deleted' if response.deleted else 'not deleted'}")]
  • Registers the 'delete-file' tool in the list_tools() decorator, including its name, description, and input schema.
    types.Tool( name="delete-file", description="Delete a file", inputSchema={ "type": "object", "properties": { "file_id": {"type": "string", "description": "The ID of the file to delete"} }, "required": ["file_id"] } )
  • Implementation of the delete_file method in LLMConnector class, which calls the OpenAI client's files.delete API.
    async def delete_file(self, file_id: str): try: response = await self.client.files.delete(file_id) return response except Exception as e: logger.error(f"Failed to delete file {file_id}: {str(e)}") raise

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/snilld-ai/openai-assistant-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server