Write file
typst_write_fileCreates or replaces an entire text file in an online Typst project, and collaborators see changes live. Use for full-file writes, not partial edits.
Instructions
Create a text file or replace its entire content. Collaborators in the web editor see the change live. Prefer typst_edit_file for changes to part of an existing file. Folders are created implicitly by the path.
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": {
"project_id": "<project_id>",
"path": "<path>",
"content": "<content>"
},
"name": "typst_write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Project-relative path like 'chapters/intro.typ', or a file ID | |
| content | Yes | Complete new file content | |
| project_id | Yes | Project ID from typst_list_projects, e.g. 'pAbC123dEf456gHi789jKl' |