Skip to main content
Glama

confirm

Finalize and execute pending changes in text files using the standardized API of the editor-mcp server. Ensures accurate and validated file modifications before completion.

Instructions

Confirm action

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • Handler function for the 'confirm' tool. Applies pending file modifications from a previous 'overwrite' call by writing pending_modified_lines to the current file. Clears selection and pending state on success. Returns success status or error if no pending changes or write fails.
    async def confirm() -> Dict[str, Any]: """Confirm action""" if self.pending_modified_lines is None or self.pending_diff is None: return {"error": "No pending changes to apply. Use overwrite first."} try: with open(self.current_file_path, "w", encoding="utf-8") as file: file.writelines(self.pending_modified_lines) result = { "status": "success", "message": f"Changes applied successfully.", } self.selected_start = None self.selected_end = None self.selected_id = None self.pending_modified_lines = None self.pending_diff = None return result except Exception as e: return {"error": f"Error writing to file: {str(e)}"}
  • Registration of the 'confirm' tool using FastMCP's @tool decorator inside TextEditorServer.register_tools() method.
    async def confirm() -> 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