Rewrite or append to a document
ragdown_writeCreate or update Markdown files safely: rewrite a whole document, append text, or add content under a heading, using base_hash to prevent overwriting unread changes.
Instructions
Rewrite or append to an existing document, or create one at a path you choose. To change part of a document, use ragdown_edit, which sends only the passages that change. By default text replaces the whole file (frontmatter included), which for an existing document needs base_hash: the hash ragdown_read_doc returned, so you never overwrite a version you have not read. A document this creates gets created_by: ragdown_write in its frontmatter, so the hash returned is of the file as written, not of text. append: true adds text at the end of the document, or with heading at the end of that section, leaving the rest as it is. If the file changed since base_hash, nothing is written: read it again and redo the edit.
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>",
"text": "<text>"
},
"name": "ragdown_write"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path of a Markdown file relative to the documents root, e.g. 'projects/alpha.md' | |
| text | Yes | The document's new Markdown, or with append, what to add | |
| append | No | ||
| heading | No | With append: add to the end of the section under this heading | |
| base_hash | No | The hash from ragdown_read_doc; required to replace an existing document | |
| session_id | No | Stable id of the conversation, recorded in the frontmatter of a document this creates |