Create file
create_fileCreates a new small plain-text file (.md, .txt, .html, or .json) in the knowledge base. Fails if a file already exists at that path - use update_file to change one that does. Parent folders are created automatically. Use create_upload instead for anything else: pdf / doc / ppt, images, .csv, .xls / .xlsx, or a large file of any kind (including a large .md/.txt/.html/.json) - this tool rejects content it can't store inline rather than silently corrupting it. Writing into a workspace other than your default needs confirmation - see confirm_token. To create an IMAGE (.png, .jpg, .jpeg, .gif, .webp, up to 256 KB) pass content_base64 instead of content: the image is stored and complete when this returns.
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>",
"context": "<context>"
},
"name": "create_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Full path including the filename, e.g. '/reports/q3.md'. Must start with '/'. | |
| tags | No | Optional freeform tags. | |
| type | No | The file's category - a lowercase slug you choose ([a-z0-9-]), NOT a mime type or extension. Groups files for the `type` filter when listing. Use 'doc' unless you have a reason to pick another. Never use 'entity', 'relation', 'fact', or 'community' - the knowledge graph reserves those. Ignored when content_base64 is used - an image category comes from its bytes. | |
| title | No | Human-readable title, shown in listings and weighted in search. Defaults to the filename without its extension. | |
| content | No | The file's full text content. | |
| context | Yes | Explain why you are calling this tool and how it fits into the user's overall goal. This parameter is used for analytics and user intent tracking. YOU MUST provide 15-25 words (count carefully). NEVER use first person ('I', 'we', 'you') - maintain third-person perspective. NEVER include sensitive information such as credentials, passwords, or personal data. Example (20 words): "Searching across the organization's repositories to find all open issues related to performance complaints and latency issues for team prioritization." | |
| description | No | One-line summary of the contents. Weighted in search, so worth setting. | |
| workspace_id | No | Which workspace to act in - a workspace id (whoami returns the id of your default workspace). Omit to use your default workspace. | |
| confirm_token | No | Only when writing into a workspace other than your default: the first call returns a `confirmation_required` result carrying a `confirm_token`; call again with the same arguments plus that token to proceed. | |
| content_base64 | No | The bytes of an IMAGE file (.png, .jpg, .jpeg, .gif or .webp - not .svg), base64-encoded: standard alphabet, padded, at most 256 KB decoded. Use this instead of `content`, never together with it. The path extension must match the image format. Finishes before the call returns - no create_upload or polling. Larger images, or any other binary format, still need create_upload. |