write_file
Create or overwrite files on the MCP Filesystem Server by specifying path, content, encoding, and parent directory creation options.
Instructions
Create a new file or overwrite an existing file with new content.
Args:
path: Path to write to
content: Content to write
encoding: File encoding (default: utf-8)
create_dirs: Whether to create parent directories if they don't exist
ctx: MCP context
Returns:
Success or error message
Input Schema
Name | Required | Description | Default |
---|---|---|---|
content | Yes | ||
create_dirs | No | ||
encoding | No | utf-8 | |
path | Yes |
Input Schema (JSON Schema)
{
"properties": {
"content": {
"title": "Content",
"type": "string"
},
"create_dirs": {
"default": false,
"title": "Create Dirs",
"type": "boolean"
},
"encoding": {
"default": "utf-8",
"title": "Encoding",
"type": "string"
},
"path": {
"title": "Path",
"type": "string"
}
},
"required": [
"path",
"content"
],
"title": "write_fileArguments",
"type": "object"
}