Skip to main content
Glama

Open in Studio

open_in_studio

Save the model as a kernelCAD project AND show it: persists a project revision, returns the interactive Studio viewer (MCP Apps / ChatGPT outputTemplate), and includes a PNG preview in the SAME tool result (image content + previewUrl when available). ONE VIEWER PER PROJECT PER RESPONSE: every call renders a new viewer card. Do all validation with evaluate_script first, then call open_in_studio exactly once, after validation succeeds; reuse the returned URL, revision and preview, and never call it again after a successful result in the same response. Re-calling with unchanged code for the same project returns that revision instead of writing a new one. CONTINUE, DO NOT DUPLICATE: to change a model you already saved, pass project: '<slug>' from the last result (or from list_my_projects) — this adds a revision to that project. Without project, the save goes to the project this chat already saved, or to your project with the same title (case, punctuation and v2/rev3/(1) ignored) from the last 24 h. Views, poses, colours and options of one design are revisions of ONE project — keep the same title and slug. Pass new_project: true only when the user wants a separate design. A different cookbook (execute_cookbook, or open_in_studio of that cookbook's unchanged source) starts its own project; pass project to add a revision, or continue_design: true to keep revising the design this chat is already saving. The result starts with the slug to pass next time, a /p/?version= link for this revision, and that revision's title. Use this when the user wants to SEE or share the model — do NOT call get_latest_render afterwards for the happy path; the preview is already here when previewDelivered is true. Pass the full .kcad source as code (optional if you just called evaluate_script — omitting reuses that last evaluated source). Code that fails evaluate_script (for example overlapping same-material members or floating pieces) is refused; fix it first. Multi-body assemblies must declare connectors + mates/joints before publish — otherwise evaluate_script fails with mechanism.orphan-part (disconnected components). Use type: 'axis' + revolute mates for shafts/hinges/gears; type: 'frame' + fastened for rigid mounts; or arm.revolute/.prismatic/.ball/.fixed. Connector types are only frame|axis|planar|ball. Status fields: ok=true means publish succeeded (under CDN, meshStatus ready/building; ok=false + meshStatus=failed means hard mesh persist failure — do not claim the viewer is ready). previewDelivered=true means this result carries a displayable PNG — only then may you tell the user a preview was shown. meshStatus mirrors get_project (ready|building|failed|missing). Under CDN, open_in_studio waits up to ~20s (OPEN_IN_STUDIO_MESH_SYNC_BUDGET_MS) for the revision mesh before returning; heavier publishes usually land meshStatus=ready. If still meshStatus=building + meshReady=false: TRANSIENT — meshUrl is the expected CDN pin; embed retries 404s. Poll get_project({slug}) until ready (it shows no viewer) — do not re-call open_in_studio, and never treat building as permanent failure/404. ALWAYS pass code when you have it (avoid no_code_to_reuse); evaluate_script reuse is a fallback. Paint phases: projectSaved / meshReady / previewDelivered are set here; viewerPainted is ONLY true after widget ack (model context / widgetState) — never claim paint from this tool alone. Do NOT call get_model_mesh or get_latest_render for interactive paint. INDEPENDENT OF EXPORT/STEP: call this for shaded paint even while export is running, timed out, or returned export.deferred — mesh paint does not wait on STEP. Never block open_in_studio on a STEP download. Pass include_preview:false to skip the rasterizer (save + viewer URLs only). Trigger phrases: "open it in Studio", "let me see it", "show me the model"; also call once after you finish a build, and once per response after each meaningful revision while iterating. ORGANIC/CAR SUCCESS GATE: for final likeness claims pass likeness_profile:"automotive" (and body_bbox/wheels/still_verdicts, or a prior verify body-likeness pass for this code). If the gate fails, ok:false with DX reference.likeness.publish-blocked|gate-required — do not claim success. Omit likeness_profile for WIP previews only. Declare dimensions in the source with shape.dimension({ kind, from, to, label }) (label is a name; the measured value is appended) and they show on the model in every viewer; add ?dims=1 to a /p link to force dimensions on. MARK & FIX: a user message starting Edit kernelCAD project <slug> (revision N): "<note>". Targets: #1 feature "<id>" ... comes from pins the user tapped in the viewer. Feature/part ids are the script's own feature and part names (assembly part names, named shapes); points are world mm. Call get_project with that slug, change only the named features near those points, keep everything else, then open_in_studio with project set to the same slug. Hosted: lib.fromSTEP / fromSTL / fromDXF / fromSVG and referenceImage accept "asset:" (from request_upload), an https:// URL or a data: URI as the path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoThe full .kcad source of the model to open in Studio (the script you have been editing). Optional: omit to reuse the source from your most recent evaluate_script call.
slugNoOlder name for `project`. Use `project`.
titleNoOptional human-readable title for the model (shown in Studio). Defaults to "Model from Claude".
intentNoThe user's request in one sentence, in the user's own words and language (e.g. 'M4 bracket for a 25 mm tube, print on Bambu A1'). Helps kernelCAD improve; leave out personal data.
wheelsNoWheel centres + radii for likeness gate [{ center:[x,y,z], radius }].
projectNoSlug of the project to update (from the last open_in_studio result, a "Saved to your projects" note, list_my_projects, or a /p/<slug> link). Adds a new revision to that project instead of creating a new one, and live-updates the user's open Studio tab.
body_bboxNoBody AABB { min:[x,y,z], max:[x,y,z] } mm — for likeness_profile gate when no session attest.
anon_tokenNoAnonymous owner token returned as `anonToken` by an earlier open_in_studio result. Pass it on every open_in_studio call, also in a new chat, so all your anonymous projects stay together and move to the user's account when they sign in. Omit when you have none.
cabin_bboxNoOptional cabin AABB for likeness gate.
parametersNoOptional list of the model's editable parameters, so Studio can render parameter controls. Each item is one control derived from the .kcad params.
attachmentsNoComplementary project files referenced by relative path from the .kcad source.
new_projectNoPass true only when the user wants a separate, new design. Default: continue this chat's project, or your project with the same title from the last 24 h. Still wins over a matching title or cookbook.
require_stillsNoForwarded to body-likeness gate (default true).
still_verdictsNoAgent still checklist for likeness gate [{ code, passed, finding, view? }].
continue_designNoPass true to add a revision to the design this chat is already saving, even when this call is a different cookbook or title. Ignored when `project` is set.
include_previewNoDefault true: render an iso PNG preview into this same tool result (reuses the server render cache when this source was already rendered). Set false to skip rasterization and return save/viewer URLs only.
likeness_profileNoHard success gate for organic/car bodies. When set, open_in_studio returns ok:false unless body-likeness is publishReady (inline body_bbox/wheels/still_verdicts, or a prior verify body-likeness pass for this exact code). Omit for WIP previews.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okNoWhether publish succeeded. Under CDN mode, false when mesh persist hard-failed (meshStatus:failed) — never ok:true with meshUrl silently omitted.
urlNoRevision-pinned /p/<slug>?version= Studio link for the revision this call saved.
slugNoThe project slug. Pass it back as `project` to save the next change to this project.
titleNoTitle stored for this revision (not a later revision of the same project).
animUrlNoCDN transforms-only animation bake URL when the script declares animationView(). ChatGPT embed Play/scrub uses this — no live session remesh.
meshUrlNoRevision-matched mesh artifact URL when available — prefer this over re-executing CAD in the embed. When meshStatus is building, this is the expected CDN URL (retry until ready).
updatedNoTrue when an existing project was updated; false when a new one was created.
versionNoImmutable Studio revision persisted by this call. Read it with get_project_revision using this slug and version.
embedUrlNoRead-only, chrome-free /embed/<slug> viewer URL — drop into an <iframe> to embed the live model in any site or widget (no login). Includes meshUrl when a revision mesh artifact is available.
meshHintNoWhen meshStatus=building: transient OCCT/CDN write — poll get_project or re-open_in_studio; never imply permanent 404/failure. Present under CDN when building.
meshErrorNoSanitized persist/repair error when meshStatus is failed.
meshReadyNoTrue only when meshStatus===ready. building+meshUrl means embed is still polling.
paintHintNoAgent guidance: do not claim interactive paint until viewerPainted.
meshStatusNoready | building | failed | missing — explicit CDN artifact state (never silently omit meshUrl under CDN mode).
previewUrlNoHTTPS URL of the PNG preview when storage signed successfully.
assetHashesNo
previewHintNo
previewViewNo
serverBuildNoDeploy identity so connector vs server mismatch is observable.
hasAnimationNoTrue when animUrl is present (animationView timeline baked at publish).
previewBytesNo
previewWidthNo
projectSavedNoTrue when the project/revision was persisted. Not the same as viewerPainted.
project_noteNoWhich project was updated or created, its URL, and how to keep working on it.
previewCachedNo
previewHeightNo
previewStatusNoincluded = PNG + URL; included_inline = PNG only; unavailable = save ok but no preview; skipped = include_preview:false.
viewerPaintedNoAlways false on tools/call. The Studio widget sets viewerPainted:true via updateModelContext after a correlated model_displayed ack.
attachmentCountNo
previewDeliveredNoTrue when this result includes a displayable PNG (image content and/or previewUrl). Only then may the agent claim a preview was shown to the user.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / continue_design
      Added value: +{
      +  "description": "Pass true to add a revision to the design this chat is already saving, even when this call is a different cookbook or title. Ignored when `project` is set.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / new_project / description
      Previous value: -"Pass true only when the user wants a separate, new design. Default: continue this chat's project, or your project with the same title from the last 24 h."New value: +"Pass true only when the user wants a separate, new design. Default: continue this chat's project, or your project with the same title from the last 24 h. Still wins over a matching title or cookbook."
    • addedOutput schema / properties / title
      Added value: +{
      +  "description": "Title stored for this revision (not a later revision of the same project).",
      +  "type": "string"
      +}
    • changedOutput schema / properties / url / description
      Previous value: -"The /p/<slug> Studio link for the model."New value: +"Revision-pinned /p/<slug>?version= Studio link for the revision this call saved."
  2. Changed1 schema field changed
    • changedInput schema / properties / new_project / description
      Previous value: -"Pass true only when the user wants a separate, new model. Default: continue this chat's project."New value: +"Pass true only when the user wants a separate, new design. Default: continue this chat's project, or your project with the same title from the last 24 h."
  3. Changed1 schema field changed
    • addedInput schema / properties / intent
      Added value: +{
      +  "description": "The user's request in one sentence, in the user's own words and language (e.g. 'M4 bracket for a 25 mm tube, print on Bambu A1'). Helps kernelCAD improve; leave out personal data.",
      +  "maxLength": 2000,
      +  "type": "string"
      +}
  4. Changed6 schema fields changed
    • addedInput schema / properties / anon_token
      Added value: +{
      +  "description": "Anonymous owner token returned as `anonToken` by an earlier open_in_studio result. Pass it on every open_in_studio call, also in a new chat, so all your anonymous projects stay together and move to the user's account when they sign in. Omit when you have none.",
      +  "maxLength": 128,
      +  "type": "string"
      +}
    • addedInput schema / properties / new_project
      Added value: +{
      +  "description": "Pass true only when the user wants a separate, new model. Default: continue this chat's project.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / project
      Added value: +{
      +  "description": "Slug of the project to update (from the last open_in_studio result, a \"Saved to your projects\" note, list_my_projects, or a /p/<slug> link). Adds a new revision to that project instead of creating a new one, and live-updates the user's open Studio tab.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / properties / slug / description
      Previous value: -"Slug returned by a previous open_in_studio call. When given, updates that existing project in place (live-updating the user's open Studio tab) instead of creating a new one."New value: +"Older name for `project`. Use `project`."
    • addedOutput schema / properties / project_note
      Added value: +{
      +  "description": "Which project was updated or created, its URL, and how to keep working on it.",
      +  "type": "string"
      +}
    • changedOutput schema / properties / slug / description
      Previous value: -"The project slug; pass it back to update this project in place."New value: +"The project slug. Pass it back as `project` to save the next change to this project."
  5. Changed6 schema fields changed
    • addedInput schema / properties / body_bbox
      Added value: +{
      +  "description": "Body AABB { min:[x,y,z], max:[x,y,z] } mm — for likeness_profile gate when no session attest.",
      +  "type": "object"
      +}
    • addedInput schema / properties / cabin_bbox
      Added value: +{
      +  "description": "Optional cabin AABB for likeness gate.",
      +  "type": "object"
      +}
    • addedInput schema / properties / likeness_profile
      Added value: +{
      +  "description": "Hard success gate for organic/car bodies. When set, open_in_studio returns ok:false unless body-likeness is publishReady (inline body_bbox/wheels/still_verdicts, or a prior verify body-likeness pass for this exact code). Omit for WIP previews.",
      +  "enum": [
      +    "automotive"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / require_stills
      Added value: +{
      +  "description": "Forwarded to body-likeness gate (default true).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / still_verdicts
      Added value: +{
      +  "description": "Agent still checklist for likeness gate [{ code, passed, finding, view? }].",
      +  "items": {
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / wheels
      Added value: +{
      +  "description": "Wheel centres + radii for likeness gate [{ center:[x,y,z], radius }].",
      +  "items": {
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  6. Changed2 schema fields changed
    • addedOutput schema / properties / animUrl
      Added value: +{
      +  "description": "CDN transforms-only animation bake URL when the script declares animationView(). ChatGPT embed Play/scrub uses this — no live session remesh.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / hasAnimation
      Added value: +{
      +  "description": "True when animUrl is present (animationView timeline baked at publish).",
      +  "type": "boolean"
      +}
  7. Changed1 schema field changed
    • addedOutput schema / properties / meshHint
      Added value: +{
      +  "description": "When meshStatus=building: transient OCCT/CDN write — poll get_project or re-open_in_studio; never imply permanent 404/failure. Present under CDN when building.",
      +  "type": "string"
      +}
  8. Changed4 schema fields changed
    • addedOutput schema / properties / meshReady
      Added value: +{
      +  "description": "True only when meshStatus===ready. building+meshUrl means embed is still polling.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / paintHint
      Added value: +{
      +  "description": "Agent guidance: do not claim interactive paint until viewerPainted.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / projectSaved
      Added value: +{
      +  "description": "True when the project/revision was persisted. Not the same as viewerPainted.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / viewerPainted
      Added value: +{
      +  "description": "Always false on tools/call. The Studio widget sets viewerPainted:true via updateModelContext after a correlated model_displayed ack.",
      +  "type": "boolean"
      +}
  9. Changed5 schema fields changed
    • addedOutput schema / properties / meshError
      Added value: +{
      +  "description": "Sanitized persist/repair error when meshStatus is failed.",
      +  "type": "string"
      +}
    • removedOutput schema / properties / meshPersistError
      Removed value: -{
      -  "description": "Set when the revision mesh could not be stored on the CDN. meshUrl is omitted in that case.",
      -  "type": "string"
      -}
    • addedOutput schema / properties / meshStatus
      Added value: +{
      +  "description": "ready | building | failed | missing — explicit CDN artifact state (never silently omit meshUrl under CDN mode).",
      +  "enum": [
      +    "ready",
      +    "building",
      +    "failed",
      +    "missing"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / properties / meshUrl / description
      Previous value: -"Revision-matched mesh artifact URL when available — prefer this over re-executing CAD in the embed."New value: +"Revision-matched mesh artifact URL when available — prefer this over re-executing CAD in the embed. When meshStatus is building, this is the expected CDN URL (retry until ready)."
    • changedOutput schema / properties / ok / description
      Previous value: -"Whether the model was persisted."New value: +"Whether publish succeeded. Under CDN mode, false when mesh persist hard-failed (meshStatus:failed) — never ok:true with meshUrl silently omitted."
  10. Changed1 schema field changed
    • addedOutput schema / properties / meshPersistError
      Added value: +{
      +  "description": "Set when the revision mesh could not be stored on the CDN. meshUrl is omitted in that case.",
      +  "type": "string"
      +}
  11. Changed3 schema fields changed
    • changedOutput schema / properties / embedUrl / description
      Previous value: -"Read-only, chrome-free /embed/<slug> viewer URL — drop into an <iframe> to embed the live model in any site or widget (no login)."New value: +"Read-only, chrome-free /embed/<slug> viewer URL — drop into an <iframe> to embed the live model in any site or widget (no login). Includes meshUrl when a revision mesh artifact is available."
    • addedOutput schema / properties / meshUrl
      Added value: +{
      +  "description": "Revision-matched mesh artifact URL when available — prefer this over re-executing CAD in the embed.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / serverBuild
      Added value: +{
      +  "description": "Deploy identity so connector vs server mismatch is observable.",
      +  "type": "string"
      +}
  12. Changed10 schema fields changed
    • addedInput schema / properties / include_preview
      Added value: +{
      +  "description": "Default true: render an iso PNG preview into this same tool result (reuses the server render cache when this source was already rendered). Set false to skip rasterization and return save/viewer URLs only.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / previewBytes
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / previewCached
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / previewDelivered
      Added value: +{
      +  "description": "True when this result includes a displayable PNG (image content and/or previewUrl). Only then may the agent claim a preview was shown to the user.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / previewHeight
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / previewHint
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / previewStatus
      Added value: +{
      +  "description": "included = PNG + URL; included_inline = PNG only; unavailable = save ok but no preview; skipped = include_preview:false.",
      +  "enum": [
      +    "included",
      +    "included_inline",
      +    "unavailable",
      +    "skipped"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / previewUrl
      Added value: +{
      +  "description": "HTTPS URL of the PNG preview when storage signed successfully.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / previewView
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / previewWidth
      Added value: +{
      +  "type": "number"
      +}
  13. Changed3 schema fields changed
    • addedInput schema / properties / attachments
      Added value: +{
      +  "description": "Complementary project files referenced by relative path from the .kcad source.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "assetSha256": {
      +        "pattern": "^[a-f0-9]{64}$",
      +        "type": "string"
      +      },
      +      "bytesBase64": {
      +        "type": "string"
      +      },
      +      "path": {
      +        "maxLength": 240,
      +        "minLength": 1,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "path"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 32,
      +  "type": "array"
      +}
    • addedOutput schema / properties / assetHashes
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / attachmentCount
      Added value: +{
      +  "minimum": 0,
      +  "type": "integer"
      +}
  14. Changed1 schema field changed
    • addedOutput schema / properties / version
      Added value: +{
      +  "description": "Immutable Studio revision persisted by this call. Read it with get_project_revision using this slug and version.",
      +  "minimum": 1,
      +  "type": "integer"
      +}
  15. Changed4 schema fields changed
    • changedInput schema / properties / parameters / description
      Previous value: -"Optional list of the model's editable parameters, so Studio can show parameter controls."New value: +"Optional list of the model's editable parameters, so Studio can render parameter controls. Each item is one control derived from the .kcad params."
    • addedInput schema / properties / parameters / items / properties
      Added value: +{
      +  "defaultValue": {
      +    "description": "Current/default value of the parameter; type matches `kind`.",
      +    "oneOf": [
      +      {
      +        "type": "number"
      +      },
      +      {
      +        "type": "boolean"
      +      },
      +      {
      +        "type": "string"
      +      }
      +    ]
      +  },
      +  "description": {
      +    "description": "Optional human-readable explanation of the parameter.",
      +    "maxLength": 200,
      +    "type": "string"
      +  },
      +  "kind": {
      +    "description": "Control type Studio should render for this parameter.",
      +    "enum": [
      +      "number",
      +      "integer",
      +      "boolean",
      +      "string"
      +    ],
      +    "type": "string"
      +  },
      +  "max": {
      +    "description": "Optional inclusive upper bound (numeric params).",
      +    "type": "number"
      +  },
      +  "min": {
      +    "description": "Optional inclusive lower bound (numeric params).",
      +    "type": "number"
      +  },
      +  "name": {
      +    "description": "Parameter identifier as used in the script (e.g. \"width\").",
      +    "maxLength": 40,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "step": {
      +    "description": "Optional slider/step increment (numeric params).",
      +    "type": "number"
      +  },
      +  "unit": {
      +    "description": "Optional unit label shown next to the control (e.g. \"mm\", \"deg\").",
      +    "maxLength": 8,
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / parameters / items / required
      Added value: +[
      +  "name",
      +  "defaultValue",
      +  "kind"
      +]
    • addedInput schema / properties / parameters / items / type
      Added value: +"object"
  16. Changed1 schema field changed
    • addedOutput schema / properties / embedUrl
      Added value: +{
      +  "description": "Read-only, chrome-free /embed/<slug> viewer URL — drop into an <iframe> to embed the live model in any site or widget (no login).",
      +  "type": "string"
      +}
  17. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "ok": {
      +      "description": "Whether the model was persisted.",
      +      "type": "boolean"
      +    },
      +    "slug": {
      +      "description": "The project slug; pass it back to update this project in place.",
      +      "type": "string"
      +    },
      +    "updated": {
      +      "description": "True when an existing project was updated; false when a new one was created.",
      +      "type": "boolean"
      +    },
      +    "url": {
      +      "description": "The /p/<slug> Studio link for the model.",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  18. Changed2 schema fields changed
    • changedInput schema / properties / code / description
      Previous value: -"The full .kcad source of the model to open in Studio (the script you have been editing)."New value: +"The full .kcad source of the model to open in Studio (the script you have been editing). Optional: omit to reuse the source from your most recent evaluate_script call."
    • changedInput schema / required
      Previous value: -[
      -  "code"
      -]New value: +[]
  19. Changed1 schema field changed
    • addedInput schema / properties / slug
      Added value: +{
      +  "description": "Slug returned by a previous open_in_studio call. When given, updates that existing project in place (live-updating the user's open Studio tab) instead of creating a new one.",
      +  "minLength": 1,
      +  "type": "string"
      +}
  20. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.