write_file
Create or overwrite text files within the filesystem base, automatically creating parent directories and validating PHP syntax before saving so broken content is rejected.
Instructions
Create or overwrite a text file (confined to the filesystem base). Parent directories are created as needed. For an existing .php file, prefer edit_file with a targeted old_string/new_string over retyping the whole file here — a full rewrite risks a transcription slip (e.g. an escaped bracket) that a partial edit can't introduce. Any .php content is syntax-checked before it touches disk; a broken write is rejected with the parse error instead of being saved, so this can't brick a live, always-loaded plugin file.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"content": "<content>"
},
"name": "write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| content | Yes |