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

Get App Source

Return an app's raw persisted source (module, frontend ui script, and styles) plus its current revision for optimistic-concurrency edits.

MCP name: get_app_source

Tool contract

{
  "annotations": {
    "destructiveHint": false,
    "openWorldHint": false,
    "readOnlyHint": true,
    "title": "Get App Source"
  },
  "description": "Return an app's raw persisted source (module, frontend ui script, and styles) plus its current revision for optimistic-concurrency edits. Pass that revision through update_app's `expected_revision` input. Use this when you need the source to inspect, debug, or edit an app the caller owns.",
  "execution": {
    "taskSupport": "forbidden"
  },
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
      "app_id": {
        "description": "The app ID (UUID)",
        "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"
      }
    },
    "required": [
      "app_id"
    ],
    "type": "object"
  },
  "name": "get_app_source",
  "outputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "$schema": {
        "const": "https://charm.ing/schema/app-manifest/2026-07-31.json",
        "description": "Exact dated canonical manifest schema URL. Omitted for legacy apps.",
        "type": "string"
      },
      "advisories": {
        "description": "Structured advisories attached when the tool detected a non-fatal authoring issue (e.g. legacy bridge usage). 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"
      },
      "appVersion": {
        "description": "Canonical apps return decimal String(revision). Legacy apps return their stored effective SemVer.",
        "type": "string"
      },
      "capabilities": {
        "additionalProperties": false,
        "description": "Capability declarations parsed from the app manifest.",
        "properties": {
          "exports": {
            "description": "WIT-style capability ids the app exposes for cross-app calls.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "imageHosts": {
            "description": "External https image hosts injected into the app CSP img-src (e.g. [\"covers.openlibrary.org\"]). Omitted when the app declares none.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "imports": {
            "description": "WIT-style capability ids the app requests (e.g. \"charming:storage/kv@1.0\"). Empty if the app declares none.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "imports",
          "exports"
        ],
        "type": "object"
      },
      "claimed": {
        "description": "True if the app is owned by an authenticated account. False for anonymous apps still in the unclaimed grace window.",
        "type": "boolean"
      },
      "description": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "Search-friendly summary set by the creating agent. Null on apps created before descriptions existed."
      },
      "displayName": {
        "description": "Human-readable name from the manifest.",
        "type": "string"
      },
      "expiresAt": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "ISO timestamp when an unclaimed app will be hard-deleted. Null for claimed apps."
      },
      "id": {
        "description": "UUID of the inspected app.",
        "type": "string"
      },
      "manifestId": {
        "description": "Effective manifest id. May differ from `sourceManifestId` when a conflicting id was rewritten on save.",
        "type": "string"
      },
      "manifestVersion": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "Deprecated public contract marker. Canonical apps return null; legacy apps return their stored contract date."
      },
      "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"
      },
      "source": {
        "additionalProperties": false,
        "description": "Persisted source bundle. The same fields accepted by create_app/update_app.",
        "properties": {
          "module": {
            "description": "Backend ES module source.",
            "type": "string"
          },
          "styles": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional CSS for the rendered app. Null if not set."
          },
          "ui": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Frontend JavaScript rendered into the #app mount point. Null if not set."
          }
        },
        "required": [
          "module",
          "ui",
          "styles"
        ],
        "type": "object"
      },
      "sourceManifestId": {
        "description": "Manifest id as authored in the persisted module source.",
        "type": "string"
      },
      "url": {
        "description": "Public app URL without an access token, built from the OWNER's handle when available (friendly form) and the UUID form otherwise. Safe to show the user. Browsers open via session cookie; agents should call get_app to mint a per-app token for write access.",
        "type": "string"
      }
    },
    "required": [
      "ok",
      "id",
      "url",
      "manifestId",
      "sourceManifestId",
      "displayName",
      "description",
      "revision",
      "appVersion",
      "manifestVersion",
      "capabilities",
      "claimed",
      "expiresAt",
      "source"
    ],
    "type": "object"
  }
}

Was this page helpful?