Skip to main content
Glama

delete_file

Remove the current file in the editor-mcp server, a Python-based text editor for managing file operations through a standardized API.

Instructions

Delete current file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Implementation of the delete_file tool. This async function deletes the currently set file using os.remove after validation checks. It returns a success message or error.
    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)}"}
  • Registration of the delete_file tool using the FastMCP @tool decorator.
    async def delete_file() -> Dict[str, Any]:

Other Tools

Related Tools

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