Update app and redeploy
update_appChange an app instance's settings (repo, branch, rootDir, runtime, build/start commands, outputDir, appPort, apiPrefix, env, repoToken) and, by default, redeploy: the pod fetches the latest commit of the branch and runs the build again. Only the fields you send change; the rest stay as stored. Same instance, same address, same /data disk (it persists across rebuilds), so a second build is faster. The build runs inside the pod (the plan is the build machine); a start command is restarted if it exits; linux/amd64 only. env: send full values for the keys you change; a masked value (***abcd) as returned by reads means 'keep the stored one', and a masked value for a key that was never set is refused. Build errors do not stop the previous version serving: call get_app_build to see state and log. Only for instances whose engine is app. With redeploy false the settings are only saved and take effect on the next rebuild.
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": {
"id": "<id>"
},
"name": "update_app"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Id of an instance whose engine is app, as returned by create_instance or list_instances. | |
| env | No | Environment variables for the app (at most 50; names like [A-Za-z_][A-Za-z0-9_]*). Put secrets here. Values are stored as-is but come back masked (***abcd) on every read; a value sent back in that masked form means 'keep the stored one'. | |
| repo | No | https git URL of the repository to deploy, e.g. https://github.com/owner/project. SSH remotes and URLs with credentials are refused; use repoToken for a private repository. | |
| branch | No | Branch to build and deploy. Defaults to main. | |
| appPort | No | Port the backend listens on inside the pod, 1024-65535. Defaults to 3000. | |
| rootDir | No | Directory inside the repository where the build runs (a monorepo's app folder). Relative path, no leading / and no ..; omit for the repository root. | |
| runtime | No | node, python, go, static or docker. Omit to let the pod detect it from the repository (node and static output are the proven paths). | |
| redeploy | No | Rebuild right after saving, so the pod builds the latest commit of the branch with the new settings. Set false to only save the settings. | |
| repoUser | No | Username to pair with repoToken. Usually omit it: the pod picks the form the git host expects (GitHub x-access-token, GitLab oauth2, ...). | |
| apiPrefix | No | Requests under this path go to the backend; everything else is served from outputDir. Defaults to /api. | |
| outputDir | No | Folder with the static build output, relative to rootDir (e.g. dist), served by nginx. Set this, startCommand, or both. | |
| repoToken | No | Access token for a private repository. Stored encrypted and never returned. Use a token scoped to that one repository. | |
| buildCommand | No | Runs once per deploy, inside the pod, from rootDir (e.g. 'npm ci && npm run build'). Omit for the default of the detected runtime. | |
| startCommand | No | Long-running backend process (e.g. 'node server/index.js'); restarted if it exits. It must listen on appPort. Set this, outputDir, or both. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Instance id. | |
| app | Yes | The stored app configuration. env values are masked (***abcd); the repository token is never returned. | |
| next | Yes | Suggested next step for the caller. | |
| saved | Yes | The new settings were stored. | |
| status | Yes | Instance lifecycle status after the call. | |
| redeployed | Yes | True when a rebuild from the latest commit was started and returned without error. | |
| endpointUrl | Yes | Public HTTPS address of the app. | |
| rebuildError | Yes | Why the rebuild failed when the settings were saved but the rebuild was refused; null otherwise. |