Publish an agent
publish_agentPublish source as an agent: a SOUL.md describing who it is, a valet.yaml declaring the skills, connectors, channels, and configuration it runs with, and any supporting files. Use it when the user wants an agent on Valet that answers on a channel or runs on a schedule. 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.
files carries the agent in the call, from any client. push: {id, commit} publishes a commit you pushed after create_push, with the sha its recipe prints; use it when you can run git with network access or changed a clone of the agent's source. A push built on a main that has since moved is merged onto it as a deploy is, and one whose tree is already deployed answers no_changes, as do files the agent already runs.
Unlike a website's or an app's, an agent's valet.yaml is yours: Valet validates it rather than writing it, and refuses one the agent rules reject. An organization connector or channel the manifest names is attached for you, but not a Slack channel, which a person sets up, or one whose attach failed. When the manifest names one that is missing or not attached, or a skill that does not resolve, nothing deploys and pending lists each with the tool that sets it up; call again with the same files after.
Publishing changes an agent that exists: create it first with create_service (kind: agent), then publish to its name. Publishing replaces the agent's source with these files, so read get_source first when the agent is not yours. An agent deploy finishes before this call returns: the answer carries the release version, and get_service reports whether the agent is running and what it holds. In an organization with release policies, the answer may carry evaluation instead of a version: the release is built and waits for its policies, and get_evaluation follows it. 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_agent"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The agent's name. The agent 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 agent's source sent in the call: valet.yaml and SOUL.md at the root, and any supporting files. For a Git push, pass push instead. | |
| org_name | No | The Valet organization to publish into. Omit to use the organization the account joined first. | |
| discard_draft | No | Set true to discard an open draft on this agent 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 deploying a second release. Use a new key for new files: a repeated key returns the earlier result even when the files changed. A call that deployed nothing gives its key back. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| org | Yes | Name of the Valet organization the call acted in. | |
| name | Yes | Name of the agent. | |
| pending | No | What the organization must set up before the agent deploys. Nothing deployed. Set each up with its tool, then call publish_agent again with the same files. Absent when the publish went through. | |
| version | No | Version number of the release the publish activated. Absent when nothing deployed: the call is pending (see pending), the release waits for its policies (see evaluation), or nothing changed. | |
| evaluation | No | The release evaluation. Without version, the release is built and waits for its policies: follow it with get_evaluation. With version, the release is live and this is its monitor-only evaluation. Absent when the release has none. | |
| no_changes | No | True when the files or pushed tree are what the agent already runs, so nothing deployed. Absent otherwise. |