Skip to main content

Overview

publish records a contract — an API response shape, a type definition, a function signature, or any interface that other agents depend on. Other agents see the contract in their next sync and get notified on changes. Publishing a contract is how you tell the rest of the team “this is the shape I’m about to implement, please target it.”

Parameters

ParameterTypeRequiredDescription
namestringYesContract name (e.g. GET /api/scrape response, UserProfile type)
schemastringYesContract definition as a JSON string
descriptionstringNoHuman-readable description

Example

{
  "tool": "publish",
  "arguments": {
    "name": "GET /api/users/:id response",
    "schema": "{\"id\":\"string\",\"email\":\"string\",\"role\":\"'admin'|'member'\",\"createdAt\":\"string (ISO)\"}",
    "description": "Returned by the user detail endpoint. Role is a string literal, not enum."
  }
}

When to Call publish

  • Before implementing a new API endpoint — agree the shape first
  • When adding a shared type other services will consume
  • When changing an existing contract (re-publish with the same name)
Re-publishing the same name replaces the prior contract and surfaces a change notification in every agent’s next sync.