Publish an app
publish_appPublish source as an app: a process Valet builds from your files and runs behind its own URL. Use it for an app that needs a server, a background process, or a database. A Procfile at the root says how to start each process type; the web type serves the app's URL and must listen on $PORT. Node, Python, and Go are supported. Read the organization's requirements with get_skill governance before calling. A policy set to block refuses a publish that fails it, and the answer names what to fix; a monitor policy only records findings, which get_evaluation lists.
With files, Valet writes the app's valet.yaml from title and description. Send source, the Procfile, configuration, and a manifest the build installs from (package.json, requirements.txt, or go.mod) as text, never installed packages. When you can run git with network access, or the app is large or holds binary files, call create_push, push, and pass push instead; the commit supplies its own valet.yaml.
Create the app first with create_service (kind: app), then publish to its name. Publishing replaces the app's source, so read get_source first when the app is not yours. Returns the app's URL and a build id, or no_changes and no build when the files or pushed tree are already running. Poll get_build every ten to fifteen seconds until deploy_state is up, idle (deployed, asleep), crashed, superseded, or refused. A crashed release leaves the last one serving, so a working URL does not prove the new release is live.
Write the app to start without its variables and resources and serve a page saying what is missing, never exiting. Then attach_resource, which takes the app's own variables too, applies both in one restart; set_env_vars restarts a running app for plain variables and again for secrets. A new app is private: only members of the organization that owns it can open it, after signing in to Valet. Use set_service_access to make it public or password-protected. Requires connecting a Valet account.
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": {
"name": "<name>"
},
"name": "publish_app"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The app's name, which is the first label of its URL. The app must exist: create it first with create_service. Publishing to it replaces its source. | |
| push | No | Publish a Git push instead of files: the id create_push returned and the commit you pushed to its branch. Use it when you can run git with network access, because it sends only what changed. Every other argument keeps its meaning. | |
| files | No | The app's source sent in the call: a Procfile at the root and the files it starts. For a Git push, pass push instead. | |
| title | No | What the app is called, written for a person. It labels the app wherever it is listed. | |
| org_name | No | The Valet organization to publish into. Omit to use the organization the account joined first. | |
| description | No | One sentence saying what the app does, for a person deciding whether to open it. | |
| discard_draft | No | Set true to discard an open draft on this app that another session left. Omit to be told about it instead. Not used with push. | |
| idempotency_key | No | An opaque key of your choosing. Repeating a call with the same key returns the first call's result instead of starting a second build. Use a new key for new files: a repeated key returns the earlier result even when the files changed. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| org | Yes | Name of the Valet organization the call acted in. | |
| url | No | URL that serves the app. Absent while the app has no route. | |
| name | Yes | Name of the app. It is the first label of its URL. | |
| build_id | No | ID of the build the publish started. Pass it to get_build and poll until deploy_state is up, idle, crashed, superseded, or refused. Absent when no build started. | |
| no_changes | No | True when the files or pushed tree are what the app already runs, so no build started. Absent otherwise. |