Patch Asset
patch_assetApply targeted text changes to an existing asset (js, css, json, svg) without re-uploading the full file. Uses find/replace on the file content. Binary assets (images, fonts) are updated by re-uploading with overwrite: true instead.
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>",
"slug": "<slug>",
"patches": "<patches>"
},
"name": "patch_asset"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes | The asset path to patch (e.g., "js/app.js", "css/style.css") | |
| patches | Yes | Array of patch operations. Each patch needs: operation ("replace" or "delete"), find (exact string to locate). For replace: also include replace (new string). | |
| project_id | Yes | The project ID | |
| base_version_hash | No | Optional. Content hash from get_asset response. If provided and mismatched, returns 409. |