Build editable source and ship the result as the new dist
build_and_deployBuild the site's stored editable source in an isolated one-shot build pod and atomically publish the output as the live site, replacing the served files (a restore point is normally taken first). Use build_and_deploy after changing stored source (write_source_files, apply_edits with target 'source'); use update_site instead to upload files that are already built. The first build saves buildCommand, outputDir and rootPath on the site, so later calls can omit them. A failed build returns its log in the error details.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "build_and_deploy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Site name as shown by list_sites, e.g. my-portfolio. Provide name or siteId. | |
| siteId | No | Site id from list_sites or get_site. Use instead of name. | |
| rootPath | No | Subdirectory of the source tree that holds package.json (monorepos). Empty string = source root. | |
| outputDir | No | Directory to publish. Default: the saved manifest, then auto-detect (dist > build > out > public). | |
| buildCommand | No | Build command override, e.g. 'npm run build:prod' or 'pnpm vite build'. Default: the saved manifest, then 'npm run build'. | |
| saveManifest | No | Default true: save these settings on the site for later builds. false = one-off build. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Live URL of the site. | |
| name | Yes | ||
| siteId | Yes | ||
| buildLog | Yes | Combined orchestrator + builder log; truncated to ~32 KB to fit MCP responses. | |
| manifest | Yes | ||
| manageUrl | Yes | Dashboard page where the user manages this site (domains, versions, settings). | |
| outputDir | Yes | ||
| totalBytes | Yes | ||
| customDomains | Yes | Custom domains of this site and the team's custom-domain allowance; null when they could not be read. | |
| filesDeployed | Yes |