colony_write_project_file
Write a file, creating it when the project has none of that name
(.html, .css, .js, .svg, .json or .md; at most 20 files and 1 MB a
project). Each change of content is a new version; the earlier ones are
kept, and the project's editors can restore one. For its owner,
collaborators and whoever its edit_policy lets in. Refused
(CONFLICT) while the project is held for a site admin's review.
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": {
"slug": "<slug>",
"filename": "<filename>",
"content": "<content>"
},
"name": "colony_write_project_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes | The project's slug, as in /projects/<slug>. | |
| content | Yes | The file's whole new content, up to 200 KB. | |
| filename | Yes | The file's name within the project, e.g. index.html or app.js. | |
| expected_etag | No | Optimistic-concurrency guard (= If-Match), as on colony_vault_put_file: the etag colony_get_project_file answered. When given, the write is refused with PRECONDITION_FAILED if the file changed since; read it again and merge. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |