MCP Python Interpreter

by yzfly
Verified

write_file

Write content to a specified file path, with options to overwrite existing files and set encoding, using the MCP Python Interpreter for efficient file management.

Instructions

Write content to a file in the working directory or system-wide if allowed. Args: file_path: Path to the file to write (relative to working directory or absolute if system access is enabled) content: Content to write to the file overwrite: Whether to overwrite the file if it exists (default: False) encoding: File encoding (default: utf-8) Returns: str: Status message about the file writing operation

Input Schema

NameRequiredDescriptionDefault
contentYes
encodingNoutf-8
file_pathYes
overwriteNo

Input Schema (JSON Schema)

{ "properties": { "content": { "title": "Content", "type": "string" }, "encoding": { "default": "utf-8", "title": "Encoding", "type": "string" }, "file_path": { "title": "File Path", "type": "string" }, "overwrite": { "default": false, "title": "Overwrite", "type": "boolean" } }, "required": [ "file_path", "content" ], "title": "write_fileArguments", "type": "object" }

You must be authenticated.

Other Tools from MCP Python Interpreter

Related Tools

ID: asvhgbf6de