Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

Publish App as Template

Use this to let people who can read an App make their own independent copies, and optionally list it in the public Template directory.

MCP name: set_template

Tool contract

{
  "annotations": {
    "destructiveHint": true,
    "openWorldHint": true,
    "readOnlyHint": false,
    "title": "Publish App as Template"
  },
  "description": "Use this to let people who can read an App make their own independent copies, and optionally list it in the public Template directory. Listing grants no access to the live App or its data.",
  "execution": {
    "taskSupport": "forbidden"
  },
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
      "app_id": {
        "description": "The app ID (UUID) to publish as a template. An anonymous App must be claimed first.",
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
        "type": "string"
      },
      "category": {
        "anyOf": [
          {
            "enum": [
              "business",
              "developer-tools",
              "education",
              "entertainment",
              "lifestyle",
              "productivity",
              "utilities"
            ],
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "Template listing category; null clears it, omit to leave it unchanged"
      },
      "content_markdown": {
        "anyOf": [
          {
            "maxLength": 20000,
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "Long-form Template listing content; null clears it, omit to leave it unchanged"
      },
      "cover_alt": {
        "description": "Nonblank cover alt text; supply with cover_asset_key",
        "maxLength": 300,
        "type": "string"
      },
      "cover_asset_key": {
        "anyOf": [
          {
            "maxLength": 128,
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "Key of an image asset uploaded to this App for the cover; null removes the cover, omit to leave it unchanged"
      },
      "cover_caption": {
        "anyOf": [
          {
            "maxLength": 300,
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "Optional cover caption; supply with cover_asset_key"
      },
      "gallery": {
        "anyOf": [
          {
            "items": {
              "additionalProperties": false,
              "properties": {
                "alt": {
                  "description": "Nonblank alt text for this screenshot",
                  "maxLength": 300,
                  "type": "string"
                },
                "asset_key": {
                  "description": "App asset key for this screenshot",
                  "maxLength": 128,
                  "type": "string"
                },
                "caption": {
                  "anyOf": [
                    {
                      "maxLength": 300,
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Optional screenshot caption"
                }
              },
              "required": [
                "asset_key",
                "alt"
              ],
              "type": "object"
            },
            "maxItems": 12,
            "type": "array"
          },
          {
            "type": "null"
          }
        ],
        "description": "Ordered screenshot records, each an image asset of this App with nonblank alt text; null or an empty array clears the gallery, omit to leave it unchanged"
      },
      "listed": {
        "description": "Whether to also list the app in Charming's public template directory for discovery. `true` lists it and needs a nonblank resulting title and summary; `false` unlists it. Omit this to leave the current listed state untouched: it is not a default-false reset, so omitting it never unlists an already-listed app.",
        "type": "boolean"
      },
      "summary": {
        "anyOf": [
          {
            "maxLength": 300,
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "Template listing summary; null clears it, omit to leave it unchanged"
      },
      "title": {
        "anyOf": [
          {
            "maxLength": 120,
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "Template listing title; null clears it, omit to leave it unchanged"
      }
    },
    "required": [
      "app_id"
    ],
    "type": "object"
  },
  "name": "set_template",
  "outputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "advisories": {
        "description": "Structured non-fatal advisories, including authoring issues and unread staff feedback responses. Each advisory.summary is also appended to the text content for the LLM path.",
        "items": {
          "additionalProperties": false,
          "properties": {
            "data": {
              "additionalProperties": {},
              "description": "Kind-specific structured payload. Shape varies per advisory kind.",
              "propertyNames": {
                "type": "string"
              },
              "type": "object"
            },
            "doc_url": {
              "description": "Optional docs pointer for this advisory kind.",
              "type": "string"
            },
            "kind": {
              "description": "Stable advisory identifier (e.g. \"legacy-bridge\").",
              "type": "string"
            },
            "severity": {
              "description": "Severity; omitted advisories are treated as 'info'.",
              "enum": [
                "info",
                "warn"
              ],
              "type": "string"
            },
            "summary": {
              "description": "Agent-facing summary. Self-sufficient; no extra context required.",
              "type": "string"
            },
            "userSummary": {
              "description": "End-user-facing summary. Set when the advisory should render in-app.",
              "type": "string"
            }
          },
          "required": [
            "kind",
            "summary"
          ],
          "type": "object"
        },
        "type": "array"
      },
      "listed": {
        "description": "Whether the app is currently listed in the public template directory, reflecting the ACTUAL resulting state — not necessarily the call's `listed` input, since an omitted `listed` leaves the prior state unchanged. A template can be copyable without being listed.",
        "type": "boolean"
      },
      "message": {
        "description": "Consequence copy the agent should surface verbatim to the user when reporting the change. Spells out that other people will get their own copy — the user's data is untouched — and, when listed, that strangers can discover it.",
        "type": "string"
      },
      "ok": {
        "const": true,
        "description": "Indicates success. Errors arrive as content with isError:true.",
        "type": "boolean"
      },
      "public_url": {
        "description": "Canonical `/templates/<handle>/<app-name>` Template page. The URL stays the same while the Template is listed or unlisted, and a repeat call returns it unchanged. Existing App readers can copy an unlisted Template; anyone can copy it when Listed. Each copy belongs to the signed-in visitor from creation, and the original is never mutated. Free of write-capable `?t=` tokens.",
        "type": "string"
      }
    },
    "required": [
      "ok",
      "public_url",
      "listed",
      "message"
    ],
    "type": "object"
  }
}

Was this page helpful?