Update file

Update a file. Requires project.files.write.

Arguments

  • project_referencestring

    Project ID or slug

  • refstring

    Content selector: main or branch:<name-or-id>. Omit for main. Release and environment snapshots are read-only. Supplied aliases must name the same content.

  • branch_idstring

    Legacy branch name or ID alias for ref=branch:<value>. Omit for main.

  • file_pathstring

    Path of the file. Send file_path or path, not two different values.

  • pathstring

    File path

  • contentstring

    Replacement textual content in main or the selected branch, stored as a new immutable version. Source-file MIME type is not writable. Do not combine with str_replace.

  • str_replaceobject

    Replace one exact occurrence in the current file. Do not combine with content.

  • expected_checksumstring

    Expected current checksum from get_file. Omission leaves full-content writes unguarded; string replacement uses the checksum read automatically.

  • expected_version_idstring

    Expected current version ID from get_file. Omission leaves full-content writes unguarded; string replacement uses the version read automatically.

Responses

curl -X POST -N "https://api.veryfront.com/mcp" \  -H "Authorization: Bearer $VERYFRONT_API_KEY" \  -H "Accept: application/json, text/event-stream" \  -H "Content-Type: application/json" \  -d '{  "jsonrpc": "2.0",  "id": 1,  "method": "tools/call",  "params": {    "name": "veryfront__update_file",    "arguments": {}  }}'
{  "jsonrpc": "2.0",  "id": 1,  "result": {    "content": [      {        "type": "text",        "text": "{\"path\":\"string\",\"id\":\"string\",\"version_id\":\"string\",\"type\":\"page\",\"size_bytes\":0,\"checksum\":\"string\",\"updated_at\":\"string\"}"      }    ],    "structuredContent": {      "path": "string",      "id": "string",      "version_id": "string",      "type": "page",      "size_bytes": 0,      "checksum": "string",      "updated_at": "string"    }  }}

The tool ran; its output is result.structuredContent.