Skip to main content
Glama

delete_file

Remove the current file from the editor. This tool deletes files to manage workspace content and free up storage.

Instructions

Delete current file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'delete_file' MCP tool. It deletes the currently set file (via set_file tool) using os.remove, resets the current_file_path, and returns success or error status.
    @self.mcp.tool() async def delete_file() -> Dict[str, Any]: """ Delete current file """ if self.current_file_path is None: return {"error": "No file path is set. Use set_file first."} try: if not os.path.exists(self.current_file_path): return {"error": f"File '{self.current_file_path}' does not exist."} os.remove(self.current_file_path) deleted_path = self.current_file_path self.current_file_path = None return { "status": "success", "message": f"File '{deleted_path}' was successfully deleted.", } except Exception as e: return {"error": f"Error deleting file: {str(e)}"}

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/danielpodrazka/editor-mcp'

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