create_file
Create new markdown or mermaid files in the knowledge vault or a project repo. The operation writes the file, indexes it, and returns metadata including ID, path, and token estimate.
Instructions
Create a new markdown or mermaid file in the knowledge base or project. This operation writes a new file to disk and adds it to the local SQLite FTS5 index. Destination can be 'knowledge' (global KB), 'project' (reference file inside a project repo), or 'kontexta' (internal Kontexta schema file). If destination is 'project' or 'kontexta', project_id is strictly required. No external auth required. Rate limits do not apply (local operation). Returns the created file metadata including its new ID, path, and estimated tokens. If the destination directory does not exist, it will be created automatically. Use this tool to instantiate new contextual documents or notes. To modify an existing file, use 'update_file' instead. Parameters: 'destination' dictates required fields; if 'project' or 'kontexta', 'project_id' must be a valid integer. 'tags' and 'folder' are optional. Pass format='mmd' to create a Mermaid diagram file (.mmd); defaults to 'md'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Optional array of tags | |
| title | Yes | Title of the file | |
| folder | No | Optional folder path | |
| format | No | File extension to write. Defaults to 'md'. | |
| content | Yes | Content of the file | |
| project_id | No | Project ID (required for project/kontexta destinations) | |
| destination | Yes | Destination type |