Create a New File
litewrite_create_fileCreates a new text file or directory in a Litewrite project. Specify the project, name, type, and optionally a parent folder and initial content.
Instructions
Create a new text file (or directory) in a Litewrite project (POST /api/internal/files/create).
Args:
projectId (string, required): The project id.
name (string, required): Name of the new file or folder, e.g. "notes.md".
type (string, required): "file" or "directory".
parentPath (string, optional): Parent directory relative to project root, e.g. "chapters".
content (string, optional): Initial text content for a file.
Returns a confirmation.
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": {
"projectId": "<projectId>",
"name": "<name>",
"type": "<type>"
},
"name": "litewrite_create_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the new file or folder | |
| type | Yes | 'file' or 'directory' | |
| content | No | Initial text content for a file | |
| projectId | Yes | The Litewrite project id | |
| parentPath | No | Parent directory, e.g. 'chapters' |