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

Copy App

Use this to give the signed-in user a private copy of an App they can edit or a Template they may copy, in one call.

MCP name: copy_app

Tool contract

{
  "annotations": {
    "destructiveHint": false,
    "openWorldHint": false,
    "readOnlyHint": false,
    "title": "Copy App"
  },
  "description": "Use this to give the signed-in user a private copy of an App they can edit or a Template they may copy, in one call. Sharing, secrets, Routines, and Webhooks stay behind; see read_docs({ path: \"capabilities/code-export.md\" }).",
  "execution": {
    "taskSupport": "forbidden"
  },
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
      "app_id": {
        "description": "The app ID (UUID) to copy.",
        "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"
      },
      "display_name": {
        "description": "Display name for the copy. Defaults to the source’s. Not accepted for package Apps, which name themselves in package.json.",
        "type": "string"
      },
      "idempotency_key": {
        "description": "Optional key of 8-100 visible ASCII characters naming this copy. A retry with the same key returns the copy (or its build) the first call made instead of making another; the same key with a different app, include_data, or manifest_id fails with idempotency_conflict. Omit it and every call makes a new copy.",
        "type": "string"
      },
      "include_data": {
        "description": "Also copy the stored data and assets. Defaults to false. Only the owner of a personally owned source can; a team app’s data is not copied. The data must fit the 24 MiB a copy carries and the account storage allowance. When the copy builds first, its data copies when the build publishes.",
        "type": "boolean"
      },
      "manifest_id": {
        "description": "Manifest id for the copy. One you already hold fails with manifest_id_conflict, so a copy never replaces an App. Omit it to take the next free id after the source’s (`<id>-2`, `<id>-3`).",
        "type": "string"
      }
    },
    "required": [
      "app_id"
    ],
    "type": "object"
  },
  "name": "copy_app",
  "outputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "anyOf": [
      {
        "$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"
          },
          "appName": {
            "description": "URL-safe slug for the app, unique per owner. Distinct from manifestId and displayName, and stable across edits — use rename_app to change it (the title changing does NOT change the slug).",
            "type": [
              "string",
              "null"
            ]
          },
          "copiedData": {
            "additionalProperties": false,
            "description": "Present when include_data copied the data on this call. Absent on an idempotency replay, which returns the earlier copy without recounting, and while an ESM copy is still building.",
            "properties": {
              "assets": {
                "description": "Assets copied.",
                "maximum": 9007199254740991,
                "minimum": 0,
                "type": "integer"
              },
              "keys": {
                "description": "Stored keys copied.",
                "maximum": 9007199254740991,
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "keys",
              "assets"
            ],
            "type": "object"
          },
          "copyKind": {
            "description": "`app` for a copy of an app you can edit; `template` for a Template copy, which records the source as its origin.",
            "enum": [
              "app",
              "template"
            ],
            "type": "string"
          },
          "icon": {
            "additionalProperties": false,
            "description": "The effective home-screen icon stored for the app. Canonical source declares it at `manifest.meta.icon`.",
            "properties": {
              "bg": {
                "description": "The icon background as a hex color (e.g. \"#1d8a4e\").",
                "type": "string"
              },
              "emoji": {
                "description": "The single emoji rendered on the icon.",
                "type": "string"
              }
            },
            "required": [
              "emoji",
              "bg"
            ],
            "type": "object"
          },
          "id": {
            "description": "UUID of the created or updated app.",
            "type": "string"
          },
          "ok": {
            "const": true,
            "description": "Indicates success. Errors arrive as content with isError:true.",
            "type": "boolean"
          },
          "revision": {
            "description": "Server-owned app source revision. Historical null counters read as 0; new apps start at 1; each successful source write advances it once. Pass this value through `expected_revision` when guarding update_app.",
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          },
          "secretsNotCopied": {
            "description": "Names of the source secrets the copy does not have. Set them on the copy before it needs them.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "shareUrl": {
            "description": "The link to give humans whenever the user wants to open or share the app. Friendly /<handle>/<app-name> form when the OWNER has a live handle and the app a slug, /app/<uuid> otherwise. Always token-free — safe to show, paste, and send. Not an API base: appending /api/<op> to the friendly form 404s; use `url` for machine calls.",
            "type": "string"
          },
          "sourceAppId": {
            "description": "The app that was copied.",
            "type": "string"
          },
          "url": {
            "description": "Machine/API URL for the app (stable /app/<uuid> form). Embeds a write-capable ?t= access token — NEVER show, paste, or send it to the user. Append /api/<op> to its path for out-of-band operation calls. For anything user-facing, use shareUrl instead.",
            "type": "string"
          },
          "warnings": {
            "description": "Non-blocking publish feedback (#1126): present when static validation found UI/backend contract mismatches or legacy icon input needed a fallback. The write succeeded; fix the named source field.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "ok",
          "id",
          "url",
          "shareUrl",
          "revision",
          "icon",
          "sourceAppId",
          "copyKind"
        ],
        "type": "object"
      },
      {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "additionalProperties": false,
        "properties": {
          "acceptedAt": {
            "type": "string"
          },
          "activeRevision": {
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          },
          "appId": {
            "description": "Existing target app ID, or the created app ID after publication.",
            "type": "string"
          },
          "attempts": {
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          },
          "buildId": {
            "description": "Durable build ID. Use get_app_build to inspect progress or source.",
            "type": "string"
          },
          "copiedData": {
            "additionalProperties": false,
            "description": "Present when include_data copied the data on this call. Absent on an idempotency replay, which returns the earlier copy without recounting, and while an ESM copy is still building.",
            "properties": {
              "assets": {
                "description": "Assets copied.",
                "maximum": 9007199254740991,
                "minimum": 0,
                "type": "integer"
              },
              "keys": {
                "description": "Stored keys copied.",
                "maximum": 9007199254740991,
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "keys",
              "assets"
            ],
            "type": "object"
          },
          "copyKind": {
            "description": "`app` for a copy of an app you can edit; `template` for a Template copy, which records the source as its origin.",
            "enum": [
              "app",
              "template"
            ],
            "type": "string"
          },
          "deadline": {
            "type": "string"
          },
          "desiredRevision": {
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          },
          "elapsedMs": {
            "minimum": 0,
            "type": "number"
          },
          "error": {
            "additionalProperties": false,
            "properties": {
              "column": {
                "description": "The 1-based column in `line`.",
                "maximum": 9007199254740991,
                "minimum": -9007199254740991,
                "type": "integer"
              },
              "details": {
                "anyOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "execution": {
                        "enum": [
                          "not_started",
                          "may_have_run"
                        ],
                        "type": "string"
                      },
                      "operationId": {
                        "minLength": 1,
                        "type": "string"
                      },
                      "reservationId": {
                        "minLength": 1,
                        "type": "string"
                      }
                    },
                    "required": [
                      "execution",
                      "operationId"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "execution": {
                        "const": "may_have_run",
                        "type": "string"
                      }
                    },
                    "required": [
                      "execution"
                    ],
                    "type": "object"
                  }
                ]
              },
              "kind": {
                "type": "string"
              },
              "line": {
                "description": "The 1-based line in `path`.",
                "maximum": 9007199254740991,
                "minimum": -9007199254740991,
                "type": "integer"
              },
              "message": {
                "type": "string"
              },
              "path": {
                "description": "The App file the failure points at, relative to the package root, when it points at one of the App's own files.",
                "type": "string"
              },
              "retryable": {
                "type": "boolean"
              },
              "specifier": {
                "type": "string"
              },
              "stage": {
                "description": "A stage only when the author's package caused the failure. `source`: the package was refused (its files, imports, or package.json, a size cap, a refused `connect-src` origin, a package name another App holds or that differs from the App's, or accepted source the current contract refuses); fix what the message names, in the file `path` names when given. `dependencies`: npm could not resolve or install the declared dependencies, or the tree has more packages than the limit; fix the package `specifier` names when given, its range in package.json, or trim the dependencies. `compile`: the compiler, or the check of the built server module, refused the App's code; fix the file and position named when given. Every other failure has no stage, because nothing in the package would fix it: a build sandbox, provider, executor, or database failing, a busy host, a cancellation, lost authority, an expired build or one that used up its attempts, an input Charming could not load, or a copy whose requested manifest id was taken. Save again.",
                "enum": [
                  "source",
                  "dependencies",
                  "compile"
                ],
                "type": "string"
              },
              "target": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "message",
              "retryable"
            ],
            "type": "object"
          },
          "finishedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "idempotencyExpiresAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "inputDigest": {
            "type": "string"
          },
          "inspectionExpiresAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "intent": {
            "description": "The accepted operation: create, update, migrate, restore, or copy.",
            "type": "string"
          },
          "lockDigest": {
            "type": "string"
          },
          "lockState": {
            "enum": [
              "locked",
              "unresolved"
            ],
            "type": "string"
          },
          "ok": {
            "const": true,
            "type": "boolean"
          },
          "queueDeadline": {
            "type": "string"
          },
          "resolvedDependencies": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Exact package versions the build resolved for the declared dependencies.",
            "propertyNames": {
              "type": "string"
            },
            "type": "object"
          },
          "retryAfterSeconds": {
            "description": "Wait at least this many seconds before polling again.",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991,
            "type": "integer"
          },
          "revision": {
            "description": "Published app source revision.",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991,
            "type": "integer"
          },
          "secretsNotCopied": {
            "description": "Names of the source secrets the copy does not have. Set them on the copy before it needs them.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "source": {
            "additionalProperties": false,
            "description": "Exact accepted source, returned only when include_source is true.",
            "properties": {
              "files": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "The accepted file tree: package.json, server.js, and any other files.",
                "propertyNames": {
                  "type": "string"
                },
                "type": "object"
              }
            },
            "required": [
              "files"
            ],
            "type": "object"
          },
          "sourceAppId": {
            "description": "The app that was copied.",
            "type": "string"
          },
          "sourceEtag": {
            "description": "The quoted ETag of the revision this build saved once an App exists; an HTTP save passes it as If-Match. It doesn't change after a later save; get_app_source returns the current revision. Before a creation publishes, the digest of the accepted input.",
            "type": "string"
          },
          "state": {
            "enum": [
              "queued",
              "resolving",
              "building",
              "validating",
              "published",
              "failed",
              "superseded",
              "canceled",
              "expired"
            ],
            "type": "string"
          },
          "statusUrl": {
            "description": "Authenticated HTTP status URL for this build.",
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "url": {
            "description": "App URL. Present only after successful publication.",
            "type": "string"
          }
        },
        "required": [
          "ok",
          "buildId",
          "intent",
          "state",
          "sourceEtag",
          "statusUrl",
          "attempts",
          "acceptedAt",
          "updatedAt",
          "finishedAt",
          "queueDeadline",
          "deadline",
          "inspectionExpiresAt",
          "idempotencyExpiresAt",
          "elapsedMs",
          "lockState",
          "inputDigest",
          "sourceAppId",
          "copyKind"
        ],
        "type": "object"
      }
    ],
    "properties": {
      "acceptedAt": {
        "type": "string"
      },
      "activeRevision": {
        "maximum": 9007199254740991,
        "minimum": 0,
        "type": "integer"
      },
      "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"
      },
      "appId": {
        "description": "Existing target app ID, or the created app ID after publication.",
        "type": "string"
      },
      "appName": {
        "description": "URL-safe slug for the app, unique per owner. Distinct from manifestId and displayName, and stable across edits — use rename_app to change it (the title changing does NOT change the slug).",
        "type": [
          "string",
          "null"
        ]
      },
      "attempts": {
        "maximum": 9007199254740991,
        "minimum": 0,
        "type": "integer"
      },
      "buildId": {
        "description": "Durable build ID. Use get_app_build to inspect progress or source.",
        "type": "string"
      },
      "copiedData": {
        "additionalProperties": false,
        "description": "Present when include_data copied the data on this call. Absent on an idempotency replay, which returns the earlier copy without recounting, and while an ESM copy is still building.",
        "properties": {
          "assets": {
            "description": "Assets copied.",
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          },
          "keys": {
            "description": "Stored keys copied.",
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "keys",
          "assets"
        ],
        "type": "object"
      },
      "copyKind": {
        "description": "`app` for a copy of an app you can edit; `template` for a Template copy, which records the source as its origin.",
        "enum": [
          "app",
          "template"
        ],
        "type": "string"
      },
      "deadline": {
        "type": "string"
      },
      "desiredRevision": {
        "maximum": 9007199254740991,
        "minimum": 0,
        "type": "integer"
      },
      "elapsedMs": {
        "minimum": 0,
        "type": "number"
      },
      "error": {
        "additionalProperties": false,
        "properties": {
          "column": {
            "description": "The 1-based column in `line`.",
            "maximum": 9007199254740991,
            "minimum": -9007199254740991,
            "type": "integer"
          },
          "details": {
            "anyOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "execution": {
                    "enum": [
                      "not_started",
                      "may_have_run"
                    ],
                    "type": "string"
                  },
                  "operationId": {
                    "minLength": 1,
                    "type": "string"
                  },
                  "reservationId": {
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "required": [
                  "execution",
                  "operationId"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "execution": {
                    "const": "may_have_run",
                    "type": "string"
                  }
                },
                "required": [
                  "execution"
                ],
                "type": "object"
              }
            ]
          },
          "kind": {
            "type": "string"
          },
          "line": {
            "description": "The 1-based line in `path`.",
            "maximum": 9007199254740991,
            "minimum": -9007199254740991,
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "path": {
            "description": "The App file the failure points at, relative to the package root, when it points at one of the App's own files.",
            "type": "string"
          },
          "retryable": {
            "type": "boolean"
          },
          "specifier": {
            "type": "string"
          },
          "stage": {
            "description": "A stage only when the author's package caused the failure. `source`: the package was refused (its files, imports, or package.json, a size cap, a refused `connect-src` origin, a package name another App holds or that differs from the App's, or accepted source the current contract refuses); fix what the message names, in the file `path` names when given. `dependencies`: npm could not resolve or install the declared dependencies, or the tree has more packages than the limit; fix the package `specifier` names when given, its range in package.json, or trim the dependencies. `compile`: the compiler, or the check of the built server module, refused the App's code; fix the file and position named when given. Every other failure has no stage, because nothing in the package would fix it: a build sandbox, provider, executor, or database failing, a busy host, a cancellation, lost authority, an expired build or one that used up its attempts, an input Charming could not load, or a copy whose requested manifest id was taken. Save again.",
            "enum": [
              "source",
              "dependencies",
              "compile"
            ],
            "type": "string"
          },
          "target": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "message",
          "retryable"
        ],
        "type": "object"
      },
      "finishedAt": {
        "type": [
          "string",
          "null"
        ]
      },
      "icon": {
        "additionalProperties": false,
        "description": "The effective home-screen icon stored for the app. Canonical source declares it at `manifest.meta.icon`.",
        "properties": {
          "bg": {
            "description": "The icon background as a hex color (e.g. \"#1d8a4e\").",
            "type": "string"
          },
          "emoji": {
            "description": "The single emoji rendered on the icon.",
            "type": "string"
          }
        },
        "required": [
          "emoji",
          "bg"
        ],
        "type": "object"
      },
      "id": {
        "description": "UUID of the created or updated app.",
        "type": "string"
      },
      "idempotencyExpiresAt": {
        "type": [
          "string",
          "null"
        ]
      },
      "inputDigest": {
        "type": "string"
      },
      "inspectionExpiresAt": {
        "type": [
          "string",
          "null"
        ]
      },
      "intent": {
        "description": "The accepted operation: create, update, migrate, restore, or copy.",
        "type": "string"
      },
      "lockDigest": {
        "type": "string"
      },
      "lockState": {
        "enum": [
          "locked",
          "unresolved"
        ],
        "type": "string"
      },
      "ok": {
        "const": true,
        "type": "boolean"
      },
      "queueDeadline": {
        "type": "string"
      },
      "resolvedDependencies": {
        "additionalProperties": {
          "type": "string"
        },
        "description": "Exact package versions the build resolved for the declared dependencies.",
        "propertyNames": {
          "type": "string"
        },
        "type": "object"
      },
      "retryAfterSeconds": {
        "description": "Wait at least this many seconds before polling again.",
        "exclusiveMinimum": 0,
        "maximum": 9007199254740991,
        "type": "integer"
      },
      "revision": {
        "description": "Server-owned app source revision. Historical null counters read as 0; new apps start at 1; each successful source write advances it once. Pass this value through `expected_revision` when guarding update_app.",
        "maximum": 9007199254740991,
        "minimum": 0,
        "type": "integer"
      },
      "secretsNotCopied": {
        "description": "Names of the source secrets the copy does not have. Set them on the copy before it needs them.",
        "items": {
          "type": "string"
        },
        "type": "array"
      },
      "shareUrl": {
        "description": "The link to give humans whenever the user wants to open or share the app. Friendly /<handle>/<app-name> form when the OWNER has a live handle and the app a slug, /app/<uuid> otherwise. Always token-free — safe to show, paste, and send. Not an API base: appending /api/<op> to the friendly form 404s; use `url` for machine calls.",
        "type": "string"
      },
      "source": {
        "additionalProperties": false,
        "description": "Exact accepted source, returned only when include_source is true.",
        "properties": {
          "files": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The accepted file tree: package.json, server.js, and any other files.",
            "propertyNames": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "required": [
          "files"
        ],
        "type": "object"
      },
      "sourceAppId": {
        "description": "The app that was copied.",
        "type": "string"
      },
      "sourceEtag": {
        "description": "The quoted ETag of the revision this build saved once an App exists; an HTTP save passes it as If-Match. It doesn't change after a later save; get_app_source returns the current revision. Before a creation publishes, the digest of the accepted input.",
        "type": "string"
      },
      "state": {
        "enum": [
          "queued",
          "resolving",
          "building",
          "validating",
          "published",
          "failed",
          "superseded",
          "canceled",
          "expired"
        ],
        "type": "string"
      },
      "statusUrl": {
        "description": "Authenticated HTTP status URL for this build.",
        "type": "string"
      },
      "updatedAt": {
        "type": "string"
      },
      "url": {
        "description": "App URL. Present only after successful publication.",
        "type": "string"
      },
      "warnings": {
        "description": "Non-blocking publish feedback (#1126): present when static validation found UI/backend contract mismatches or legacy icon input needed a fallback. The write succeeded; fix the named source field.",
        "items": {
          "type": "string"
        },
        "type": "array"
      }
    },
    "required": [
      "ok",
      "sourceAppId",
      "copyKind"
    ],
    "type": "object"
  }
}

Was this page helpful?