create_file
Create a new file with specified content and auto-generate parent directories. Use for writing new files or fully replacing existing ones.
Instructions
CREATE A NEW FILE with specified content. Primary tool for file creation - use whenever you need to create or completely replace a file's content. Automatically creates parent directories. Keywords: create, new file, write file, save file, make file. / 创建新文件并写入内容。这是文件创建的主要工具。自动创建父目录。关键词:创建、新建文件、写入文件、保存文件。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The file path to create. Can be absolute or relative to the current working directory. Supports nested paths - parent directories will be created automatically. Examples: 'src/main.go' (creates src/ directory if needed), '/tmp/test.txt' (absolute path), 'docs/api/readme.md' (creates docs/api/ directories). | |
| content | Yes | The content to write to the file. Can be any text content including source code, configuration files, JSON/YAML data, plain text, or documentation. The content will completely replace any existing file content. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | ||
| success | Yes |