Skip to content
Charming Docs
Esc
navigateopen⌘Jpreview
On this page

Publish App as Template

Publish a Charming app as a template: makes it copyable, and optionally lists it in Charming's public template directory.

MCP name: set_template

Tool contract

{
  "annotations": {
    "destructiveHint": false,
    "openWorldHint": true,
    "readOnlyHint": false,
    "title": "Publish App as Template"
  },
  "description": "Publish a Charming app as a template: makes it copyable, and optionally lists it in Charming's public template directory. Use this to let anyone who opens the app's URL get their own brand-new copy, while the original is never mutated by visitors. Each copy is an independent app the visitor can keep and later claim by signing up. Pass `listed: true` to also mark it for discovery, or `listed: false` to unlist it. Omitting `listed` is a patch, not a reset: it leaves the current listed state exactly as it is (an already-listed app stays listed; a never-listed app stays unlisted), so re-affirming that an app is a template never surprises the owner by delisting it. Idempotent: calling with the same effective `listed` state as the current one returns the same URL without re-firing analytics. Anonymous apps cannot be made into templates; the app must be claimed first.",
  "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",
        "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"
      },
      "listed": {
        "description": "Whether to also list the app in Charming's public template directory for discovery. `true` lists it, `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"
      }
    },
    "required": [
      "app_id"
    ],
    "type": "object"
  },
  "name": "set_template",
  "outputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "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": "Public share URL for the now-copyable app. Friendly `/<handle>/<app-name>` form when available, `/app/<uuid>` otherwise. Visitors opening this URL get their own brand-new editable copy; 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?