Publishing

publish_site

Promote the site's current draft to a new published version and return the report. Use when the draft is ready to go live. After publish, call render_page to visually verify. Do not use to preview without publishing.

Behaviour

Effect
Destructive. It can remove or overwrite existing data.
Repeat calls
Idempotent. Repeating the same call produces the same result.
Plan
Available on every plan, including free.

Parameters

NameTypeRequiredDescription
request_idstringYesUnique mutation ID. Reuse only to replay identical arguments; use a new ID for changed arguments or after E_CONFLICT.
site_iduuidYesSite UUID from list_sites or create_site.
if_revisionstring or nullYesCurrent selected revision from get_site, list_pages or get_page. Use null only when source is none. Refresh after E_CONFLICT.

Returns

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "outcome": {
          "type": "string",
          "const": "published"
        },
        "published_version": {
          "type": "object",
          "properties": {
            "label": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "published_at": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            "page_count": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          "required": [
            "label",
            "published_at",
            "page_count"
          ],
          "additionalProperties": false
        },
        "content": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "const": "published"
            },
            "revision": {
              "type": "string",
              "pattern": "^r_[0-9a-f]{32}$"
            },
            "page_count": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          "required": [
            "source",
            "revision",
            "page_count"
          ],
          "additionalProperties": false
        },
        "report": {
          "type": "object",
          "properties": {
            "block_reasons": {
              "maxItems": 50,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            },
            "warnings": {
              "maxItems": 50,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            },
            "review_flags": {
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            },
            "info": {
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            },
            "orphan_paths": {
              "maxItems": 100,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "pattern": "^\\/[A-Za-z0-9/_-]*$"
              }
            },
            "broken_links": {
              "maxItems": 100,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "pattern": "^\\/[A-Za-z0-9/_-]*$"
                  },
                  "href": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "from",
                  "href"
                ],
                "additionalProperties": false
              }
            },
            "safe_browsing_hit_count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000
            },
            "render_validation": {
              "type": "object",
              "properties": {
                "html": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                },
                "markdown": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                },
                "jsx": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                },
                "svg": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                },
                "mermaid": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                }
              },
              "required": [
                "html",
                "markdown",
                "jsx",
                "svg",
                "mermaid"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "block_reasons",
            "warnings",
            "review_flags",
            "info",
            "orphan_paths",
            "broken_links",
            "safe_browsing_hit_count",
            "render_validation"
          ],
          "additionalProperties": false
        },
        "idempotency_replay": {
          "type": "boolean"
        }
      },
      "required": [
        "outcome",
        "published_version",
        "content",
        "report",
        "idempotency_replay"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "outcome": {
          "type": "string",
          "const": "blocked"
        },
        "content": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "const": "draft"
            },
            "revision": {
              "type": "string",
              "pattern": "^r_[0-9a-f]{32}$"
            },
            "page_count": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          "required": [
            "source",
            "revision",
            "page_count"
          ],
          "additionalProperties": false
        },
        "report": {
          "type": "object",
          "properties": {
            "block_reasons": {
              "maxItems": 50,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            },
            "warnings": {
              "maxItems": 50,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            },
            "review_flags": {
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            },
            "info": {
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            },
            "orphan_paths": {
              "maxItems": 100,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "pattern": "^\\/[A-Za-z0-9/_-]*$"
              }
            },
            "broken_links": {
              "maxItems": 100,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "pattern": "^\\/[A-Za-z0-9/_-]*$"
                  },
                  "href": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "from",
                  "href"
                ],
                "additionalProperties": false
              }
            },
            "safe_browsing_hit_count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000
            },
            "render_validation": {
              "type": "object",
              "properties": {
                "html": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                },
                "markdown": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                },
                "jsx": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                },
                "svg": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                },
                "mermaid": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                }
              },
              "required": [
                "html",
                "markdown",
                "jsx",
                "svg",
                "mermaid"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "block_reasons",
            "warnings",
            "review_flags",
            "info",
            "orphan_paths",
            "broken_links",
            "safe_browsing_hit_count",
            "render_validation"
          ],
          "additionalProperties": false
        },
        "idempotency_replay": {
          "type": "boolean"
        }
      },
      "required": [
        "outcome",
        "content",
        "report",
        "idempotency_replay"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "outcome": {
          "type": "string",
          "const": "no_changes"
        },
        "content": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string",
                  "const": "published"
                },
                "revision": {
                  "type": "string",
                  "pattern": "^r_[0-9a-f]{32}$"
                },
                "page_count": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 50
                }
              },
              "required": [
                "source",
                "revision",
                "page_count"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string",
                  "const": "none"
                },
                "revision": {
                  "type": "null"
                },
                "page_count": {
                  "type": "number",
                  "const": 0
                }
              },
              "required": [
                "source",
                "revision",
                "page_count"
              ],
              "additionalProperties": false
            }
          ]
        },
        "idempotency_replay": {
          "type": "boolean"
        }
      },
      "required": [
        "outcome",
        "content",
        "idempotency_replay"
      ],
      "additionalProperties": false
    }
  ],
  "type": "object"
}

Using it

publish_site is called by an AI assistant connected to Sentway over MCP, not by hand. Point the assistant at the Sentway MCP endpoint and complete the OAuth flow, and the tool becomes available in the same session as the other 38 Sentway tools. See connecting over MCP.