Tool details
| Field | Value |
|---|---|
| Name | update_file |
| Group | Files |
Playground
Input schema
input-schema.json
{
"type": "object",
"properties": {
"project_reference": {
"type": "string",
"description": "Project ID or slug"
},
"branch_id": {
"type": "string",
"description": "Branch ID (omit for main branch)"
},
"path": {
"type": "string",
"description": "File path"
},
"content": {
"type": "string",
"description": "Full new file content. Do not combine with str_replace."
},
"str_replace": {
"type": "object",
"properties": {
"old_string": {
"type": "string",
"minLength": 1,
"description": "Exact current text. It must match exactly once."
},
"new_string": {
"type": "string",
"description": "Replacement text. Use an empty string to delete the matched text."
}
},
"required": [
"old_string",
"new_string"
],
"additionalProperties": false,
"description": "Replace one exact occurrence in the current file. Do not combine with content."
},
"expected_checksum": {
"type": "string",
"description": "Checksum returned by get_file. Provide it to avoid overwriting concurrent edits."
},
"expected_version_id": {
"type": "string",
"description": "Version ID returned by get_file. Provide it to avoid overwriting concurrent edits."
}
},
"required": [
"path"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Input schema for the update_file tool."
}
Output schema
output-schema.json
{
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The path associated with this tool result."
}
},
"required": [
"path"
],
"additionalProperties": false,
"description": "Structured result returned by the update_file tool.",
"$schema": "http://json-schema.org/draft-07/schema#"
}