create_file
Create new markdown or mermaid files in a knowledge base or project, automatically writing to disk and indexing for search. Supports optional tags and folders.
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 |
|---|---|---|---|
| title | Yes | Title of the file | |
| content | Yes | Content of the file | |
| destination | Yes | Destination type | |
| project_id | No | Project ID (required for project/kontexta destinations) | |
| folder | No | Optional folder path | |
| tags | No | Optional array of tags | |
| format | No | File extension to write. Defaults to 'md'. |