kernelCAD is an MCP server published by com.kernelcad, hosted at mcp.kernelcad.com. When last checked on 2026-11-22 it was working: it answers and lists its tools. It declares 78 tools, including review_paint_peek_latest, open_in_studio, get_project, get_project_revision, get_latest_render.
CAD in ChatGPT and Claude: editable parts, STEP/STL/drawings, in-chat 3D, automatic checks.
Nothing else in the archive shares these values.
Inferred from the host name and headers: what a server runs on, not who runs it.
Return the newest brush-painted review packet from a Studio session. After sharing a /p/<slug> link, the user can open it in the browser and paint marks over the 3D viewport to give visual feedback. Call this tool with the `slug` from that link to see the strokes — screenshot + mask + struck part names plus an optional one-line note and intent tags (e.g. "too thick", "missing", "wrong angle") describing WHAT is wrong — and act on the feedback. The slug is the capability: no OAuth required when passing `slug`; private projects require the owner to be signed in. Omit `slug` to fetch your own latest packet from your signed-in account (requires OAuth). By default returns short-lived signed Storage URLs for the screenshot + mask + meta.json plus the struck part names — small and context-friendly. Pass `paths_only: false` to also base64-inline the PNGs for clients that cannot fetch the signed URLs over HTTP.
| Parameter | Type | Description |
|---|---|---|
| slug | string | Project slug from open_in_studio/get_project/a /p/<slug> link. When given, returns the latest brush packet painted on that project's page — works without OAuth; the slug is the capability. Omit to use your signed-in account's latest packet. |
Too large to show here.
Squares are this server's values; dots are other servers sharing them. A shared address or publisher is a lead, not proof of a common operator.
| paths_only | boolean | Controls PNG delivery. Default (omitted or true): return only signed URLs + struck part names — the small, context-friendly response; fetch the bytes via the signed URLs. Set false to also base64-inline the screenshot + mask PNGs for clients that cannot fetch the URLs over HTTP (larger response). |
| freshness_sec | integer | Maximum packet age in seconds. Default 1800 (30 min). Use a smaller value for "what did I just paint" or a larger one for "earlier today". |
{
"name": "review_paint_peek_latest",
"title": "Get Latest Painted Review Feedback",
"description": "Return the newest brush-painted review packet from a Studio session. After sharing a /p/<slug> link, the user can open it in the browser and paint marks over the 3D viewport to give visual feedback. Call this tool with the `slug` from that link to see the strokes — screenshot + mask + struck part names plus an optional one-line note and intent tags (e.g. \"too thick\", \"missing\", \"wrong angle\") describing WHAT is wrong — and act on the feedback. The slug is the capability: no OAuth required when passing `slug`; private projects require the owner to be signed in. Omit `slug` to fetch your own latest packet from your signed-in account (requires OAuth). By default returns short-lived signed Storage URLs for the screenshot + mask + meta.json plus the struck part names — small and context-friendly. Pass `paths_only: false` to also base64-inline the PNGs for clients that cannot fetch the signed URLs over HTTP.",
"inputSchema": {
"type": "object",
"properties": {
"slug": {
"type": "string",
"description": "Project slug from open_in_studio/get_project/a /p/<slug> link. When given, returns the latest brush packet painted on that project's page — works without OAuth; the slug is the capability. Omit to use your signed-in account's latest packet."
},
"paths_only": {
"type": "boolean",
"description": "Controls PNG delivery. Default (omitted or true): return only signed URLs + struck part names — the small, context-friendly response; fetch the bytes via the signed URLs. Set false to also base64-inline the screenshot + mask PNGs for clients that cannot fetch the URLs over HTTP (larger response)."
},
"freshness_sec": {
"type": "integer",
"minimum": 1,
"description": "Maximum packet age in seconds. Default 1800 (30 min). Use a smaller value for \"what did I just paint\" or a larger one for \"earlier today\"."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Get Latest Painted Review Feedback",
"readOnlyHint": true,
"openWorldHint": false,
"destructiveHint": false
}
}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). For a new private model pass new_project:true, privacy:"private" over an authenticated connection. Private models return an owner-only Studio link without public preview, mesh or animation artifacts. For an update, pass expected_version from your read to refuse overwriting a newer revision. Decide electronics actions from the user request at render time: pass show_electronics:true only when electronics are relevant. Default false for mechanical-only models such as mugs. This is an agent decision, not geometry or linked-PCB detection. Use hardware_pack for optional LabWired context. 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. A heavy model can answer status:"running" (code tool.still-running) before the client times out; that is NOT a success: call open_in_studio again with exactly the same arguments, which joins the running save and returns its result. 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/<slug>?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. A broken mechanism verdict alone does NOT refuse: the revision is saved, Studio shows "Mechanism broken", and the result returns mechanismSummary (statement, maxLevel, failures with the joint). Tell the user the mechanism is broken; do not call it working. 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 the project revision was saved (projectSaved=true). meshSaved reports whether its display mesh is persisted; meshStatus=failed means meshSaved=false, but the saved project remains usable for geometry checks. Do not claim its 3D 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; he
| Parameter | Type | Description |
|---|---|---|
| code | string | 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. |
| slug | string | Older name for `project`. Use `project`. |
| title | string | Optional human-readable title for the model (shown in Studio). Defaults to "Model from Claude". |
| intent | string | 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. |
| wheels | array | Wheel centres + radii for likeness gate [{ center:[x,y,z], radius }]. |
| privacy | string | Creation only. Default public_unlisted preserves link sharing. private requires authentication and does not publish preview, mesh or animation artifacts. Use new_project:true when creating an independent private model. Existing project visibility is preserved; omit this field on updates. |
| project | string | 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. |
| body_bbox | object | Body AABB { min:[x,y,z], max:[x,y,z] } mm — for likeness_profile gate when no session attest. |
| anon_token | string | 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. |
{
"name": "open_in_studio",
"title": "Open in Studio",
"description": "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). For a new private model pass new_project:true, privacy:\"private\" over an authenticated connection. Private models return an owner-only Studio link without public preview, mesh or animation artifacts. For an update, pass expected_version from your read to refuse overwriting a newer revision. Decide electronics actions from the user request at render time: pass show_electronics:true only when electronics are relevant. Default false for mechanical-only models such as mugs. This is an agent decision, not geometry or linked-PCB detection. Use hardware_pack for optional LabWired context. 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. A heavy model can answer status:\"running\" (code tool.still-running) before the client times out; that is NOT a success: call open_in_studio again with exactly the same arguments, which joins the running save and returns its result. 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/<slug>?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. A broken mechanism verdict alone does NOT refuse: the revision is saved, Studio shows \"Mechanism broken\", and the result returns mechanismSummary (statement, maxLevel, failures with the joint). Tell the user the mechanism is broken; do not call it working. 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 the project revision was saved (projectSaved=true). meshSaved reports whether its display mesh is persisted; meshStatus=failed means meshSaved=false, but the saved project remains usable for geometry checks. Do not claim its 3D 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; he",
"inputSchema": {
"type": "object",
"required": [],
"properties": {
"code": {
"type": "string",
"minLength": 1,
"description": "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."
},
"slug": {
"type": "string",
"minLength": 1,
"description": "Older name for `project`. Use `project`."
},
"title": {
"type": "string",
"description": "Optional human-readable title for the model (shown in Studio). Defaults to \"Model from Claude\"."
},
"intent": {
"type": "string",
"maxLength": 2000,
"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."
},
"wheels": {
"type": "array",
"items": {
"type": "object"
},
"description": "Wheel centres + radii for likeness gate [{ center:[x,y,z], radius }]."
},
"privacy": {
"enum": [
"private",
"public_unlisted"
],
"type": "string",
"description": "Creation only. Default public_unlisted preserves link sharing. private requires authentication and does not publish preview, mesh or animation artifacts. Use new_project:true when creating an independent private model. Existing project visibility is preserved; omit this field on updates."
},
"project": {
"type": "string",
"minLength": 1,
"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."
},
"body_bbox": {
"type": "object",
"description": "Body AABB { min:[x,y,z], max:[x,y,z] } mm — for likeness_profile gate when no session attest."
},
"anon_token": {
"type": "string",
"maxLength": 128,
"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."
},
"cabin_bbox": {
"type": "object",
"description": "Optional cabin AABB for likeness gate."
},
"parameters": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"defaultValue",
"kind"
],
"properties": {
"max": {
"type": "number",
"description": "Optional inclusive upper bound (numeric params)."
},
"min": {
"type": "number",
"description": "Optional inclusive lower bound (numeric params)."
},
"kind": {
"enum": [
"number",
"integer",
"boolean",
"string"
],
"type": "string",
"description": "Control type Studio should render for this parameter."
},
"name": {
"type": "string",
"maxLength": 40,
"minLength": 1,
"description": "Parameter identifier as used in the script (e.g. \"width\")."
},
"step": {
"type": "number",
"description": "Optional slider/step increment (numeric params)."
},
"unit": {
"type": "string",
"maxLength": 8,
"description": "Optional unit label shown next to the control (e.g. \"mm\", \"deg\")."
},
"description": {
"type": "string",
"maxLength": 200,
"description": "Optional human-readable explanation of the parameter."
},
"defaultValue": {
"oneOf": [
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "string"
}
],
"description": "Current/default value of the parameter; type matches `kind`."
}
}
},
"description": "Optional list of the model's editable parameters, so Studio can render parameter controls. Each item is one control derived from the .kcad params."
},
"attachments": {
"type": "array",
"items": {
"type": "object",
"required": [
"path"
],
"properties": {
"path": {
"type": "string",
"maxLength": 240,
"minLength": 1
},
"assetSha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"bytesBase64": {
"type": "string"
}
},
"additionalProperties": false
},
"maxItems": 64,
"description": "Complementary project files referenced by relative path from the .kcad source."
},
"new_project": {
"type": "boolean",
"description": "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."
},
"require_stills": {
"type": "boolean",
"description": "Forwarded to body-likeness gate (default true)."
},
"still_verdicts": {
"type": "array",
"items": {
"type": "object"
},
"description": "Agent still checklist for likeness gate [{ code, passed, finding, view? }]."
},
"continue_design": {
"type": "boolean",
"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."
},
"include_preview": {
"type": "boolean",
"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."
},
"expected_version": {
"type": "integer",
"minimum": 1,
"description": "Update only. The revision read before editing. Refuses the save if another writer changed it; read and reconcile the current revision before retrying. Requires project or slug and cannot be combined with new_project:true."
},
"likeness_profile": {
"enum": [
"automotive"
],
"type": "string",
"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."
},
"show_electronics": {
"type": "boolean",
"description": "Agent render decision. Default false. Set true to show Electronics in LabWired when relevant to the requested design, even before a PCB exists. Set false for mechanical-only models. Existing links never override this decision."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"description": "Whether the project revision was saved (same meaning as projectSaved). A failed display mesh does not make this false; inspect meshSaved and meshStatus."
},
"url": {
"type": "string",
"description": "Revision-pinned /p/<slug>?version= Studio link for the revision this call saved."
},
"slug": {
"type": "string",
"description": "The project slug. Pass it back as `project` to save the next change to this project."
},
"title": {
"type": "string",
"description": "Title stored for this revision (not a later revision of the same project)."
},
"animUrl": {
"type": "string",
"description": "CDN transforms-only animation bake URL when the script declares animationView(). ChatGPT embed Play/scrub uses this — no live session remesh."
},
"meshUrl": {
"type": "string",
"description": "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)."
},
"privacy": {
"enum": [
"private",
"public_unlisted",
"public_featured"
],
"type": "string",
"description": "Saved project visibility. Private projects have no public artifact URLs in this result."
},
"updated": {
"type": "boolean",
"description": "True when an existing project was updated; false when a new one was created."
},
"version": {
"type": "integer",
"minimum": 1,
"description": "Immutable Studio revision persisted by this call. Read it with get_project_revision using this slug and version."
},
"embedUrl": {
"type": "string",
"description": "Read-only /embed/<slug> viewer URL. Public projects can be embedded without login. Private projects do not support anonymous embedding; open url in Studio as the owner."
},
"meshHint": {
"type": "string",
"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."
},
"meshError": {
"type": "string",
"description": "Sanitized persist/repair error when meshStatus is failed."
},
"meshReady": {
"type": "boolean",
"description": "True only when meshStatus===ready. building+meshUrl means embed is still polling."
},
"meshSaved": {
"type": "boolean",
"description": "Whether the revision display mesh is persisted. False while building or after meshStatus:failed."
},
"paintHint": {
"type": "string",
"description": "Agent guidance: do not claim interactive paint until viewerPainted."
},
"meshStatus": {
"enum": [
"ready",
"building",
"failed",
"missing"
],
"type": "string",
"description": "ready | building | failed | missing — artifact state. Private projects return missing with no public artifacts; meshHint explains authenticated viewing."
},
"previewUrl": {
"type": "string",
"description": "HTTPS URL of the PNG preview when storage signed successfully."
},
"project_id": {
"type": "string",
"description": "Stable project UUID for collaboration tools such as join_project."
},
"assetHashes": {
"type": "array",
"items": {
"type": "string"
}
},
"previewHint": {
"type": "string"
},
"previewView": {
"type": "string"
},
"serverBuild": {
"type": "string",
"description": "Deploy identity so connector vs server mismatch is observable."
},
"hasAnimation": {
"type": "boolean",
"description": "True when animUrl is present (animationView timeline baked at publish)."
},
"previewBytes": {
"type": "number"
},
"previewWidth": {
"type": "number"
},
"projectSaved": {
"type": "boolean",
"description": "True when the project/revision was persisted. Not the same as viewerPainted."
},
"project_note": {
"type": "string",
"description": "Which project was updated or created, its URL, and how to keep working on it."
},
"previewCached": {
"type": "boolean"
},
"previewHeight": {
"type": "number"
},
"previewStatus": {
"enum": [
"included",
"included_inline",
"unavailable",
"skipped"
],
"type": "string",
"description": "included = PNG + URL; included_inline = PNG only; unavailable = save ok but no preview; skipped = include_preview:false or a private project."
},
"viewerPainted": {
"type": "boolean",
"description": "Always false on tools/call. The Studio widget sets viewerPainted:true via updateModelContext after a correlated model_displayed ack."
},
"attachmentCount": {
"type": "integer",
"minimum": 0
},
"meshDownloadUrl": {
"type": "string",
"description": "Stored-only API download of the verified immutable revision bytes, pinned by producer provenance. Available when the mesh is ready."
},
"mechanismSummary": {
"type": "object",
"description": "Mechanism verdict of the saved code (same as evaluate_script mechanismSummary), stored with the revision for the Studio badge. maxLevel error = \"Mechanism broken\" (saved anyway; statement names the joint), warning = \"Motion not checked\", ok = \"Motion checked\". Absent for a static model.",
"additionalProperties": true
},
"previewDelivered": {
"type": "boolean",
"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."
},
"show_electronics": {
"type": "boolean",
"description": "Explicit agent electronics visibility decision for this render."
}
},
"additionalProperties": true
},
"annotations": {
"title": "Open in Studio",
"readOnlyHint": false,
"openWorldHint": true,
"destructiveHint": false
}
}Use this when you need to reopen a saved project or browse what the user has saved — it fetches a kernelCAD Studio project, or lists the signed-in user's saved projects. Pass `slug` (from a /p/<slug> link or a prior listing) to fetch that project's full .kcad source and metadata — then edit and open_in_studio with the same slug so the user's open tab updates live. Private projects require their owner's OAuth connection. OMIT `slug` to list the signed-in user's saved projects (most recently updated first); that listing mode requires the OAuth connection and does NOT paint — prefer list_my_projects to find a project to continue. Read-only: this tool never shows a viewer (only open_in_studio does, once per response). Paint phases: projectSaved/meshReady reflect fetch state; viewerPainted stays false. Use open_in_studio (with code) to publish+paint — do NOT call get_model_mesh or get_latest_render for interactive paint.
| Parameter | Type | Description |
|---|---|---|
| slug | string | The project slug from a listing or a /p/<slug> Studio link. Omit to list the signed-in user's saved projects. |
{
"name": "get_project",
"title": "Get Project",
"description": "Use this when you need to reopen a saved project or browse what the user has saved — it fetches a kernelCAD Studio project, or lists the signed-in user's saved projects. Pass `slug` (from a /p/<slug> link or a prior listing) to fetch that project's full .kcad source and metadata — then edit and open_in_studio with the same slug so the user's open tab updates live. Private projects require their owner's OAuth connection. OMIT `slug` to list the signed-in user's saved projects (most recently updated first); that listing mode requires the OAuth connection and does NOT paint — prefer list_my_projects to find a project to continue. Read-only: this tool never shows a viewer (only open_in_studio does, once per response). Paint phases: projectSaved/meshReady reflect fetch state; viewerPainted stays false. Use open_in_studio (with code) to publish+paint — do NOT call get_model_mesh or get_latest_render for interactive paint.",
"inputSchema": {
"type": "object",
"properties": {
"slug": {
"type": "string",
"minLength": 1,
"description": "The project slug from a listing or a /p/<slug> Studio link. Omit to list the signed-in user's saved projects."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"description": "Whether the read succeeded."
},
"url": {
"type": "string",
"description": "Fetch mode: revision-pinned /p/<slug>?version= link."
},
"code": {
"type": "string",
"description": "Fetch mode: the full .kcad source."
},
"slug": {
"type": "string",
"description": "Fetch mode: the project slug."
},
"title": {
"type": "string",
"description": "Fetch mode: the project title."
},
"assets": {
"type": "object",
"description": "Complementary files keyed by source-relative path.",
"additionalProperties": true
},
"meshUrl": {
"type": "string",
"description": "Fetch mode: revision-matched mesh artifact URL when available — FunnelViewer loads it instead of re-executing CAD. When meshStatus is building, this is the expected CDN URL (retry until ready)."
},
"privacy": {
"type": "string",
"description": "Fetch mode: the project privacy."
},
"version": {
"type": "number",
"description": "Fetch mode: the project version."
},
"embedUrl": {
"type": "string",
"description": "Fetch mode: revision-pinned chrome-free /embed/<slug>?revision= viewer URL (includes meshUrl when available)."
},
"meshHint": {
"type": "string",
"description": "Fetch mode: transient build guidance, or the authenticated viewing requirement for a private project."
},
"projects": {
"type": "array",
"items": {},
"description": "List mode (no slug): the user's saved projects."
},
"meshError": {
"type": "string",
"description": "Fetch mode: sanitized repair/persist error when meshStatus is failed."
},
"meshReady": {
"type": "boolean",
"description": "Fetch mode: true only when meshStatus===ready."
},
"paintHint": {
"type": "string"
},
"meshStatus": {
"type": "string",
"description": "Fetch mode: ready | building | failed | missing. Private projects return missing and no public artifact URLs."
},
"parameters": {
"type": "array",
"items": {},
"description": "Fetch mode: the model's editable parameters."
},
"updated_at": {
"type": "string",
"description": "Fetch mode: last-updated timestamp."
},
"serverBuild": {
"type": "string",
"description": "Deploy identity (package+git SHA@boot time) so connector lag is observable."
},
"projectSaved": {
"type": "boolean",
"description": "Fetch mode: true when the project was loaded."
},
"viewerPainted": {
"type": "boolean",
"description": "Always false on tools/call; widget sets true after correlated model_displayed."
},
"meshDownloadUrl": {
"type": "string",
"description": "Stored-only API download of the verified immutable revision bytes, pinned by producer provenance. Available when the mesh is ready."
}
},
"additionalProperties": true
},
"annotations": {
"title": "Get Project",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}Fetch the exact immutable .kcad source and parameters captured at a prior `open_in_studio` version. Use this to read-after-write verify a release: pass the returned `slug` and `version`, then hash or inspect the returned source. Public/unlisted projects use the slug as capability; private projects require the owner's OAuth connection.
| Parameter | Type | Description |
|---|---|---|
| slug * | string | Project slug returned by open_in_studio. |
| version * | integer | Positive immutable revision version returned by open_in_studio. |
{
"name": "get_project_revision",
"title": "Get Project Revision",
"description": "Fetch the exact immutable .kcad source and parameters captured at a prior `open_in_studio` version. Use this to read-after-write verify a release: pass the returned `slug` and `version`, then hash or inspect the returned source. Public/unlisted projects use the slug as capability; private projects require the owner's OAuth connection.",
"inputSchema": {
"type": "object",
"required": [
"slug",
"version"
],
"properties": {
"slug": {
"type": "string",
"minLength": 1,
"description": "Project slug returned by open_in_studio."
},
"version": {
"type": "integer",
"minimum": 1,
"description": "Positive immutable revision version returned by open_in_studio."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"ok",
"slug",
"version",
"code",
"parameters"
],
"properties": {
"ok": {
"type": "boolean",
"description": "Whether the revision was found and readable."
},
"code": {
"type": "string",
"description": "Exact .kcad source captured at this revision."
},
"slug": {
"type": "string",
"description": "Project slug."
},
"title": {
"type": "string",
"description": "Title captured with this revision. Absent on revisions snapshotted before titles were stored."
},
"assets": {
"type": "object",
"description": "Immutable complementary-file manifest.",
"additionalProperties": true
},
"version": {
"type": "integer",
"minimum": 1,
"description": "Immutable revision version."
},
"parameters": {
"type": "array",
"items": {},
"description": "Exact editable parameters captured at this revision."
}
},
"additionalProperties": false
},
"annotations": {
"title": "Get Project Revision",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}Render a project's current model server-side and return it as an inline image so you can SEE what you built. Prefer open_in_studio for the happy path — it already includes an iso PNG preview in the same publish result when previewDelivered is true. Use this tool for a different `view`, a contact sheet (`view:"all"`), or when you only have a slug and are not publishing. Call with that `slug` to inspect whether the build looks right. CRITICAL — the image is rendered from the MODEL on the server; it does NOT reflect the user's Studio camera, zoom, or screen. NEVER ask the user to rotate, zoom, pan, move the camera, close a slider, or change their view to help you see — you cannot affect their screen and it cannot affect this render. To see a different angle, call this tool again with a different `view`. By DEFAULT (omit `view`, or `view:"all"`) it returns a CONTACT SHEET of all six canonical views in one labeled image — a 3×2 grid, top row [iso, front, right], bottom row [back, left, top] — so you can judge the model from every side regardless of its orientation (e.g. to find which side has the doors). Pass a single `view` (iso/front/back/left/right/top) for one large render of that angle. DETERMINISTIC: the same model + view always returns the same bytes — identical bytes are NOT a stale/lagging snapshot. If you changed the model, push it with open_in_studio FIRST, then re-render to see the change. The image is always current and never a blank capture. Colors and shading match Studio (same palette / base-material color). The slug is the capability: no OAuth for public/unlisted; private projects require the owner signed in. The PNG is base64-inlined as a real image block by default; pass `paths_only: true` for metadata only. No renderable geometry or a mesh failure → { ok: false, error, hint }, never a blank image. error "mesh_timeout" means the model took too long to build for a preview; the source is not wrong (it still exports) — do not rewrite it to fix the render.
| Parameter | Type | Description |
|---|---|---|
| slug * | string | Project slug from open_in_studio/get_project/a /p/<slug> link. The slug is the capability — public/unlisted projects need no OAuth; private projects require the owner to be signed in. |
| view | string | View to render. Default "all" = a labeled contact sheet of every canonical angle (iso/front/back/left/right/top) — best for judging the whole model. Pass a single view name for one large render of that angle. |
| paths_only | boolean | Controls PNG delivery. Default false: base64-inline the rendered PNG so clients that cannot fetch a URL over HTTP (e.g. a sandboxed agent) can still see it. Set true to return only metadata (smaller response). |
{
"name": "get_latest_render",
"title": "Get Latest Render",
"description": "Render a project's current model server-side and return it as an inline image so you can SEE what you built. Prefer open_in_studio for the happy path — it already includes an iso PNG preview in the same publish result when previewDelivered is true. Use this tool for a different `view`, a contact sheet (`view:\"all\"`), or when you only have a slug and are not publishing. Call with that `slug` to inspect whether the build looks right. CRITICAL — the image is rendered from the MODEL on the server; it does NOT reflect the user's Studio camera, zoom, or screen. NEVER ask the user to rotate, zoom, pan, move the camera, close a slider, or change their view to help you see — you cannot affect their screen and it cannot affect this render. To see a different angle, call this tool again with a different `view`. By DEFAULT (omit `view`, or `view:\"all\"`) it returns a CONTACT SHEET of all six canonical views in one labeled image — a 3×2 grid, top row [iso, front, right], bottom row [back, left, top] — so you can judge the model from every side regardless of its orientation (e.g. to find which side has the doors). Pass a single `view` (iso/front/back/left/right/top) for one large render of that angle. DETERMINISTIC: the same model + view always returns the same bytes — identical bytes are NOT a stale/lagging snapshot. If you changed the model, push it with open_in_studio FIRST, then re-render to see the change. The image is always current and never a blank capture. Colors and shading match Studio (same palette / base-material color). The slug is the capability: no OAuth for public/unlisted; private projects require the owner signed in. The PNG is base64-inlined as a real image block by default; pass `paths_only: true` for metadata only. No renderable geometry or a mesh failure → { ok: false, error, hint }, never a blank image. error \"mesh_timeout\" means the model took too long to build for a preview; the source is not wrong (it still exports) — do not rewrite it to fix the render.",
"inputSchema": {
"type": "object",
"required": [
"slug"
],
"properties": {
"slug": {
"type": "string",
"minLength": 1,
"description": "Project slug from open_in_studio/get_project/a /p/<slug> link. The slug is the capability — public/unlisted projects need no OAuth; private projects require the owner to be signed in."
},
"view": {
"enum": [
"all",
"iso",
"front",
"back",
"left",
"right",
"top"
],
"type": "string",
"description": "View to render. Default \"all\" = a labeled contact sheet of every canonical angle (iso/front/back/left/right/top) — best for judging the whole model. Pass a single view name for one large render of that angle."
},
"paths_only": {
"type": "boolean",
"description": "Controls PNG delivery. Default false: base64-inline the rendered PNG so clients that cannot fetch a URL over HTTP (e.g. a sandboxed agent) can still see it. Set true to return only metadata (smaller response)."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"description": "Whether a render was produced."
},
"hint": {
"type": "string",
"description": "Next-action hint when ok is false."
},
"view": {
"type": "string",
"description": "The view that was rendered (when ok)."
},
"bytes": {
"type": "number",
"description": "PNG byte length (when ok)."
},
"error": {
"type": "string",
"description": "Error code when ok is false (e.g. \"empty_geometry\", \"mesh_failed\", \"mesh_timeout\")."
},
"width": {
"type": "number",
"description": "Rendered image edge in px (when ok)."
},
"height": {
"type": "number",
"description": "Rendered image edge in px (when ok)."
},
"image_b64": {
"type": "string",
"description": "Base64-encoded PNG bytes, present when inlined (paths_only=false) and under the size cap."
},
"truncated": {
"type": "boolean",
"description": "Set when inline was requested but the PNG exceeded the size cap."
}
},
"additionalProperties": true
},
"annotations": {
"title": "Get Latest Render",
"readOnlyHint": true,
"openWorldHint": false,
"destructiveHint": false
}
}Return the raw per-feature triangle mesh (positions/indices/normals) of a project by slug. Pass version for an exact immutable revision; omission reads the current model. The result echoes slug and version. For the in-chat 3D viewer widget to render geometry; delivered over the MCP Apps bridge. The slug is the capability: public/unlisted need no OAuth; private requires the owner signed in. This tool returns geometry without publishing a mesh, preview or animation artifact.
| Parameter | Type | Description |
|---|---|---|
| slug * | string | Project slug from open_in_studio/get_project. |
| version | integer | Exact immutable revision from open_in_studio/get_project_revision. Omit only to read the current model. |
{
"name": "get_model_mesh",
"title": "Get Model Mesh",
"description": "Return the raw per-feature triangle mesh (positions/indices/normals) of a project by slug. Pass version for an exact immutable revision; omission reads the current model. The result echoes slug and version. For the in-chat 3D viewer widget to render geometry; delivered over the MCP Apps bridge. The slug is the capability: public/unlisted need no OAuth; private requires the owner signed in. This tool returns geometry without publishing a mesh, preview or animation artifact.",
"inputSchema": {
"type": "object",
"required": [
"slug"
],
"properties": {
"slug": {
"type": "string",
"minLength": 1,
"description": "Project slug from open_in_studio/get_project."
},
"version": {
"type": "integer",
"minimum": 1,
"description": "Exact immutable revision from open_in_studio/get_project_revision. Omit only to read the current model."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Get Model Mesh",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}Use this when the user has a photo, PDF drawing, STEP, STL, DXF, SVG or 3MF file on their device and you need it in a kernelCAD tool (trace_from_image, drawing_to_cad, mesh_to_features, inspect of:"step", or lib.fromSTEP / fromSTL / fromDXF / fromSVG / referenceImage in a script). Do not ask the user to paste the file as text or base64, and do not type coordinates from an image by hand. Returns a one-time `uploadUrl` (valid 30 minutes) and an `asset` reference. Give the user the link; after they say the upload is done, pass the `asset` value ("asset:<id>") as the file argument, for example trace_from_image({ imageUrl: "asset:<id>" }) or lib.fromSTEP("asset:<id>"). If the file is already at a public https:// URL, pass that URL instead. On clients that support MCP URL elicitation the upload page opens for the user directly and the call returns once the file is stored (status "uploaded"); then use the asset right away without asking the user anything.
| Parameter | Type | Description |
|---|---|---|
| purpose | string | Optional short note shown on the upload page, e.g. "the photo of the worn bracket". |
{
"name": "request_upload",
"title": "Request File Upload",
"description": "Use this when the user has a photo, PDF drawing, STEP, STL, DXF, SVG or 3MF file on their device and you need it in a kernelCAD tool (trace_from_image, drawing_to_cad, mesh_to_features, inspect of:\"step\", or lib.fromSTEP / fromSTL / fromDXF / fromSVG / referenceImage in a script). Do not ask the user to paste the file as text or base64, and do not type coordinates from an image by hand. Returns a one-time `uploadUrl` (valid 30 minutes) and an `asset` reference. Give the user the link; after they say the upload is done, pass the `asset` value (\"asset:<id>\") as the file argument, for example trace_from_image({ imageUrl: \"asset:<id>\" }) or lib.fromSTEP(\"asset:<id>\"). If the file is already at a public https:// URL, pass that URL instead. On clients that support MCP URL elicitation the upload page opens for the user directly and the call returns once the file is stored (status \"uploaded\"); then use the asset right away without asking the user anything.",
"inputSchema": {
"type": "object",
"properties": {
"purpose": {
"type": "string",
"maxLength": 200,
"description": "Optional short note shown on the upload page, e.g. \"the photo of the worn bracket\"."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Request File Upload",
"readOnlyHint": false,
"openWorldHint": false,
"destructiveHint": false
}
}Return the kernelcad-authoring skill — conventions for writing .kcad.ts scripts (API surface, parameters, evaluation contract, common pitfalls) — in sections. Call with NO arguments first: you get the quick-start (units, axes, the return rule, the rules that prevent most failures, the intent → API routing table, the "Before you finish" checklist) and an index of every section with a one-line summary (under 17k chars). Then pull what you need: `{ section: "<id>" }` returns one section (e.g. "top-level-functions", "materials", "dfm-gates-print-readiness"); `{ query: "fillet after subtract" }` returns the best-matching sections. `{ section: "all" }` returns the full ~140k-char skill (SKILL.md plus its reference files) — only if your client accepts large responses. Clients that list resources can also read `kernelcad://skills/authoring` (the SKILL.md core). OUTPUT: { uri, mimeType, mode, text, sections? } — `mode` is index | section | search | all | not-found. Lookup responses include `kernelSource`: the exact kernel package version/revision, composed runtime source hash, and version-pinned public authoring/API references.
| Parameter | Type | Description |
|---|---|---|
| query | string | Keywords to search section titles and bodies (e.g. "sweep along helix"). |
| topic | string | Alias of section; also accepts a loose title such as 'materials' or 'cli commands'. |
| section | string | Section id from the index (e.g. 'top-level-functions'), or 'all' for the full skill. |
{
"name": "lookup_authoring_skill",
"title": "Look Up Authoring Skill",
"description": "Return the kernelcad-authoring skill — conventions for writing .kcad.ts scripts (API surface, parameters, evaluation contract, common pitfalls) — in sections.\n\nCall with NO arguments first: you get the quick-start (units, axes, the return rule, the rules that prevent most failures, the intent → API routing table, the \"Before you finish\" checklist) and an index of every section with a one-line summary (under 17k chars). Then pull what you need: `{ section: \"<id>\" }` returns one section (e.g. \"top-level-functions\", \"materials\", \"dfm-gates-print-readiness\"); `{ query: \"fillet after subtract\" }` returns the best-matching sections. `{ section: \"all\" }` returns the full ~140k-char skill (SKILL.md plus its reference files) — only if your client accepts large responses.\n\nClients that list resources can also read `kernelcad://skills/authoring` (the SKILL.md core).\n\nOUTPUT: { uri, mimeType, mode, text, sections? } — `mode` is index | section | search | all | not-found. Lookup responses include `kernelSource`: the exact kernel package version/revision, composed runtime source hash, and version-pinned public authoring/API references.",
"inputSchema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Keywords to search section titles and bodies (e.g. \"sweep along helix\")."
},
"topic": {
"type": "string",
"description": "Alias of section; also accepts a loose title such as 'materials' or 'cli commands'."
},
"section": {
"type": "string",
"description": "Section id from the index (e.g. 'top-level-functions'), or 'all' for the full skill."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Look Up Authoring Skill",
"readOnlyHint": true,
"openWorldHint": false,
"destructiveHint": false
}
}Mesh a kernelCAD .kcad.ts source server-side and return a COMPACT geometry summary — overall bounds plus, per feature, its id, kind, triangle count, and bounding box. Use this to INSPECT a model's geometry without a viewer: confirm a part is the size/shape you expect, see how many triangles each feature contributes, or check that every feature produced geometry. This runs the full server-side OCCT pipeline (the same one the Studio renderer uses), so it evaluates modern sources (assembly, path, .material, …) that the legacy client worker cannot. INPUT: `source` (required) the .kcad.ts script text; `fileName` (optional) a label for diagnostics; `params` (optional) a map of parameter-name → number overrides applied before meshing (stateless slider recompute). OUTPUT: { ok, bounds, featureCount, features: [{ id, kind, triangleCount, bbox: { min:[x,y,z], max:[x,y,z] } }], failedFeatureIds, diagnostics }. `ok` is true when every feature meshed; `failedFeatureIds` lists features that failed to compile (and `ok` is then false). Raw vertex/index/normal arrays are NEVER returned — this is a summary only. To SEE the rendered model, call open_in_studio (includes PNG preview + viewer); use get_latest_render only for alternate views.
| Parameter | Type | Description |
|---|---|---|
| params | object | Optional map of parameter-name → numeric value, applied as overrides before meshing (stateless slider recompute). |
| source * | string | The .kcad.ts script source to mesh. |
| fileName | string | Optional file-name label used in diagnostics (does not affect geometry). |
{
"name": "mesh_summary",
"title": "Summarize Mesh Geometry",
"description": "Mesh a kernelCAD .kcad.ts source server-side and return a COMPACT geometry summary — overall bounds plus, per feature, its id, kind, triangle count, and bounding box.\n\nUse this to INSPECT a model's geometry without a viewer: confirm a part is the size/shape you expect, see how many triangles each feature contributes, or check that every feature produced geometry. This runs the full server-side OCCT pipeline (the same one the Studio renderer uses), so it evaluates modern sources (assembly, path, .material, …) that the legacy client worker cannot.\n\nINPUT: `source` (required) the .kcad.ts script text; `fileName` (optional) a label for diagnostics; `params` (optional) a map of parameter-name → number overrides applied before meshing (stateless slider recompute).\n\nOUTPUT: { ok, bounds, featureCount, features: [{ id, kind, triangleCount, bbox: { min:[x,y,z], max:[x,y,z] } }], failedFeatureIds, diagnostics }. `ok` is true when every feature meshed; `failedFeatureIds` lists features that failed to compile (and `ok` is then false). Raw vertex/index/normal arrays are NEVER returned — this is a summary only. To SEE the rendered model, call open_in_studio (includes PNG preview + viewer); use get_latest_render only for alternate views.",
"inputSchema": {
"type": "object",
"required": [
"source"
],
"properties": {
"params": {
"type": "object",
"description": "Optional map of parameter-name → numeric value, applied as overrides before meshing (stateless slider recompute).",
"additionalProperties": {
"type": "number"
}
},
"source": {
"type": "string",
"minLength": 1,
"description": "The .kcad.ts script source to mesh."
},
"fileName": {
"type": "string",
"description": "Optional file-name label used in diagnostics (does not affect geometry)."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Summarize Mesh Geometry",
"readOnlyHint": true,
"openWorldHint": false,
"destructiveHint": false
}
}Use this when the user needed something kernelCAD does not have, so the gap is recorded instead of papered over. kind: asset (search_assets returned coverage none or poor: the catalog does not model it), capability (a tool cannot do what was needed), output (a tool answered, but not with what was needed), docs (a tool description did not say how to use it). One short sentence in `need`; name the tool in `tool` when one fell short. Stores no personal data beyond your account id when signed in. Then tell the user plainly what is missing.
| Parameter | Type | Description |
|---|---|---|
| kind | string | one of ["asset","capability","output","docs"] |
| need * | string | What was needed, e.g. "low-poly lunar lander for a moon base scene". |
| tool | string | The tool that fell short, if any (e.g. search_assets). |
| context | string | Optional: what the user was building. |
{
"name": "report_need",
"title": "Report a Missing Asset or Capability",
"description": "Use this when the user needed something kernelCAD does not have, so the gap is recorded instead of papered over. kind: asset (search_assets returned coverage none or poor: the catalog does not model it), capability (a tool cannot do what was needed), output (a tool answered, but not with what was needed), docs (a tool description did not say how to use it). One short sentence in `need`; name the tool in `tool` when one fell short. Stores no personal data beyond your account id when signed in. Then tell the user plainly what is missing.",
"inputSchema": {
"type": "object",
"required": [
"need"
],
"properties": {
"kind": {
"enum": [
"asset",
"capability",
"output",
"docs"
],
"type": "string",
"default": "asset"
},
"need": {
"type": "string",
"maxLength": 500,
"description": "What was needed, e.g. \"low-poly lunar lander for a moon base scene\"."
},
"tool": {
"type": "string",
"maxLength": 128,
"description": "The tool that fell short, if any (e.g. search_assets)."
},
"context": {
"type": "string",
"maxLength": 1000,
"description": "Optional: what the user was building."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Report a Missing Asset or Capability",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": false
}
}Build the electrical netlist from a schematic — the flat connectivity of every component pin and net, the way KiCad's netlist export works. Use this to turn a schematic description into machine-readable connectivity: which pins share a net, what each component connects to, and which pins are left unconnected. Feed the result to erc_run for rule checking, or to a BOM/PCB step. INPUT: `schematic` — { title?, components: [{ reference, value?, footprint?, libpart?, unit?, dnp?, pins: [{ pin, pinFunction?, pinType?, hiddenPower? }] }], nets: [{ name, netClass?, diffPairPartner?, endpoints: [{ component, pin }] }], noConnects?: [{ component, pin, reason? }] }. Field names follow KiCad's netlist vocabulary (reference, value, footprint, libpart, unit, pin, pinType) so a KiCad .net file maps onto it directly. OUTPUT: { title?, nets: [{ name, netClass?, endpoints, components, diffPairPartner? }], components: [{ reference, value?, footprint?, libpart?, unit?, dnp?, pinCount, pinNets }], pins: [{ component, pin, net|null, pinFunction?, pinType }], stats: { components, nets, pins, unconnectedPins } }. `pinNets` maps each pin to its net name, or null when unconnected. Deterministic: the same schematic always yields the same order.
| Parameter | Type | Description |
|---|---|---|
| schematic * | object |
{
"name": "netlist_export",
"title": "Export Schematic Netlist",
"description": "Build the electrical netlist from a schematic — the flat connectivity of every component pin and net, the way KiCad's netlist export works.\n\nUse this to turn a schematic description into machine-readable connectivity: which pins share a net, what each component connects to, and which pins are left unconnected. Feed the result to erc_run for rule checking, or to a BOM/PCB step.\n\nINPUT: `schematic` — { title?, components: [{ reference, value?, footprint?, libpart?, unit?, dnp?, pins: [{ pin, pinFunction?, pinType?, hiddenPower? }] }], nets: [{ name, netClass?, diffPairPartner?, endpoints: [{ component, pin }] }], noConnects?: [{ component, pin, reason? }] }. Field names follow KiCad's netlist vocabulary (reference, value, footprint, libpart, unit, pin, pinType) so a KiCad .net file maps onto it directly.\n\nOUTPUT: { title?, nets: [{ name, netClass?, endpoints, components, diffPairPartner? }], components: [{ reference, value?, footprint?, libpart?, unit?, dnp?, pinCount, pinNets }], pins: [{ component, pin, net|null, pinFunction?, pinType }], stats: { components, nets, pins, unconnectedPins } }. `pinNets` maps each pin to its net name, or null when unconnected. Deterministic: the same schematic always yields the same order.",
"inputSchema": {
"type": "object",
"required": [
"schematic"
],
"properties": {
"schematic": {
"type": "object",
"required": [
"components",
"nets"
],
"properties": {
"nets": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"endpoints"
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "Net name. Repeating a name merges the nets (net labels on several sheets)."
},
"netClass": {
"type": "string",
"description": "Net class, e.g. \"Default\", \"Power\", \"HighSpeedDiff\"."
},
"endpoints": {
"type": "array",
"items": {
"type": "object",
"required": [
"component",
"pin"
],
"properties": {
"pin": {
"type": "string",
"description": "Pin number on that component."
},
"component": {
"type": "string",
"description": "Reference designator of the component."
}
}
},
"description": "Pins electrically common on this net."
},
"diffPairPartner": {
"type": "string",
"description": "The other member of this differential pair, when declared."
}
}
},
"description": "Nets (electrically common pin sets)."
},
"title": {
"type": "string",
"description": "Optional schematic title, used in diagnostics context."
},
"components": {
"type": "array",
"items": {
"type": "object",
"required": [
"reference",
"pins"
],
"properties": {
"dnp": {
"type": "boolean",
"description": "Do-not-populate marker."
},
"pins": {
"type": "array",
"items": {
"type": "object",
"required": [
"pin"
],
"properties": {
"pin": {
"type": "string",
"minLength": 1,
"description": "Pin number/name, e.g. \"1\", \"A3\", \"GND\"."
},
"pinType": {
"enum": [
"input",
"output",
"bidirectional",
"tri_state",
"passive",
"free",
"unspecified",
"power_in",
"power_out",
"open_collector",
"open_emitter",
"no_connect"
],
"type": "string",
"description": "Electrical type (KiCad pin electrical types). Defaults to \"unspecified\"."
},
"hiddenPower": {
"type": "boolean",
"description": "True for a hidden power pin implicitly connected by the symbol. ERC does not report it unconnected."
},
"pinFunction": {
"type": "string",
"description": "Pin function label, e.g. \"VCC\", \"RESET\"."
}
}
},
"description": "Pins declared by the library part. A component with no pins cannot appear in a netlist."
},
"unit": {
"type": "integer",
"minimum": 1,
"description": "Unit index (1-based) for multi-unit parts."
},
"value": {
"type": "string",
"description": "Value, e.g. \"10k\", \"STM32G0\", \"100nF\"."
},
"libpart": {
"type": "string",
"description": "Library part id, e.g. \"Device:R\"."
},
"footprint": {
"type": "string",
"description": "Footprint id from the footprint library, e.g. \"Package_SO:SOIC-8_3.9x4.9mm_P1.27mm\"."
},
"reference": {
"type": "string",
"minLength": 1,
"description": "Reference designator, e.g. \"R1\", \"U3\", \"J2\". Must be unique."
}
}
},
"description": "Placed component instances."
},
"noConnects": {
"type": "array",
"items": {
"type": "object",
"required": [
"component",
"pin"
],
"properties": {
"pin": {
"type": "string"
},
"reason": {
"type": "string",
"description": "Optional free-text reason carried from the schematic."
},
"component": {
"type": "string"
}
}
},
"description": "Explicit no-connect markers — pins deliberately left unused."
}
}
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Export Schematic Netlist",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Ask a net-level question about a schematic: what connects to what. MODES (`query`): • "net" — the full membership of one net (`net` required). • "pin" — which net a component pin is on (`component` + `pin` required). • "component" — every net a component touches (`component` required). • "shares" — do two pins share a net (`component`+`pin` and `otherComponent`+`otherPin`). • "unconnected" — every pin with no net. • "summary" — counts only. INPUT: `schematic` (same shape as netlist_export) plus the mode selector and its arguments. OUTPUT: { query, found, ... } — for "net", the net with its endpoints; for "pin", the net name or null; for "component", the list of nets and the pin→net map; for "shares", a boolean; for "unconnected", the list of pins; for "summary", the stats.
| Parameter | Type | Description |
|---|---|---|
| net | string | mode "net": the net name to look up. |
| pin | string | mode "pin"/"shares": the pin number. |
| query * | string | Which question to answer. |
| otherPin | string | mode "shares": the second pin number. |
| component | string | mode "pin"/"component"/"shares": the reference designator. |
| schematic * | object | |
| otherComponent | string | mode "shares": the second reference designator. |
{
"name": "netlist_query",
"title": "Query Netlist Connectivity",
"description": "Ask a net-level question about a schematic: what connects to what.\n\nMODES (`query`):\n • \"net\" — the full membership of one net (`net` required).\n • \"pin\" — which net a component pin is on (`component` + `pin` required).\n • \"component\" — every net a component touches (`component` required).\n • \"shares\" — do two pins share a net (`component`+`pin` and `otherComponent`+`otherPin`).\n • \"unconnected\" — every pin with no net.\n • \"summary\" — counts only.\n\nINPUT: `schematic` (same shape as netlist_export) plus the mode selector and its arguments.\n\nOUTPUT: { query, found, ... } — for \"net\", the net with its endpoints; for \"pin\", the net name or null; for \"component\", the list of nets and the pin→net map; for \"shares\", a boolean; for \"unconnected\", the list of pins; for \"summary\", the stats.",
"inputSchema": {
"type": "object",
"required": [
"schematic",
"query"
],
"properties": {
"net": {
"type": "string",
"description": "mode \"net\": the net name to look up."
},
"pin": {
"type": "string",
"description": "mode \"pin\"/\"shares\": the pin number."
},
"query": {
"enum": [
"net",
"pin",
"component",
"shares",
"unconnected",
"summary"
],
"type": "string",
"description": "Which question to answer."
},
"otherPin": {
"type": "string",
"description": "mode \"shares\": the second pin number."
},
"component": {
"type": "string",
"description": "mode \"pin\"/\"component\"/\"shares\": the reference designator."
},
"schematic": {
"type": "object",
"required": [
"components",
"nets"
],
"properties": {
"nets": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"endpoints"
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "Net name. Repeating a name merges the nets (net labels on several sheets)."
},
"netClass": {
"type": "string",
"description": "Net class, e.g. \"Default\", \"Power\", \"HighSpeedDiff\"."
},
"endpoints": {
"type": "array",
"items": {
"type": "object",
"required": [
"component",
"pin"
],
"properties": {
"pin": {
"type": "string",
"description": "Pin number on that component."
},
"component": {
"type": "string",
"description": "Reference designator of the component."
}
}
},
"description": "Pins electrically common on this net."
},
"diffPairPartner": {
"type": "string",
"description": "The other member of this differential pair, when declared."
}
}
},
"description": "Nets (electrically common pin sets)."
},
"title": {
"type": "string",
"description": "Optional schematic title, used in diagnostics context."
},
"components": {
"type": "array",
"items": {
"type": "object",
"required": [
"reference",
"pins"
],
"properties": {
"dnp": {
"type": "boolean",
"description": "Do-not-populate marker."
},
"pins": {
"type": "array",
"items": {
"type": "object",
"required": [
"pin"
],
"properties": {
"pin": {
"type": "string",
"minLength": 1,
"description": "Pin number/name, e.g. \"1\", \"A3\", \"GND\"."
},
"pinType": {
"enum": [
"input",
"output",
"bidirectional",
"tri_state",
"passive",
"free",
"unspecified",
"power_in",
"power_out",
"open_collector",
"open_emitter",
"no_connect"
],
"type": "string",
"description": "Electrical type (KiCad pin electrical types). Defaults to \"unspecified\"."
},
"hiddenPower": {
"type": "boolean",
"description": "True for a hidden power pin implicitly connected by the symbol. ERC does not report it unconnected."
},
"pinFunction": {
"type": "string",
"description": "Pin function label, e.g. \"VCC\", \"RESET\"."
}
}
},
"description": "Pins declared by the library part. A component with no pins cannot appear in a netlist."
},
"unit": {
"type": "integer",
"minimum": 1,
"description": "Unit index (1-based) for multi-unit parts."
},
"value": {
"type": "string",
"description": "Value, e.g. \"10k\", \"STM32G0\", \"100nF\"."
},
"libpart": {
"type": "string",
"description": "Library part id, e.g. \"Device:R\"."
},
"footprint": {
"type": "string",
"description": "Footprint id from the footprint library, e.g. \"Package_SO:SOIC-8_3.9x4.9mm_P1.27mm\"."
},
"reference": {
"type": "string",
"minLength": 1,
"description": "Reference designator, e.g. \"R1\", \"U3\", \"J2\". Must be unique."
}
}
},
"description": "Placed component instances."
},
"noConnects": {
"type": "array",
"items": {
"type": "object",
"required": [
"component",
"pin"
],
"properties": {
"pin": {
"type": "string"
},
"reason": {
"type": "string",
"description": "Optional free-text reason carried from the schematic."
},
"component": {
"type": "string"
}
}
},
"description": "Explicit no-connect markers — pins deliberately left unused."
}
}
},
"otherComponent": {
"type": "string",
"description": "mode \"shares\": the second reference designator."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Query Netlist Connectivity",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Run an electrical rule check (ERC) on a schematic and return structured diagnostics — the KiCad ERC step, over MCP. CHECKS: duplicate reference designators; net endpoints naming an unknown component or pin; unconnected pins (ignoring hidden power pins and explicit no-connects); single-pin nets; driver conflicts (two outputs on one net); power_in pins with no power_out source; input pins with no driver; no-connect markers on connected or non-existent pins; incomplete differential pairs; empty nets. INPUT: `schematic` (same shape as netlist_export), `ignore` (optional array of rule codes to suppress, e.g. ["erc.net-single-pin"]), `treatUnspecifiedAsPassive` (optional; when true an "unspecified" pin counts as passive for the input-not-driven check). OUTPUT: { ok, counts: { error, warn, info }, diagnostics: [{ code, severity, message, hint?, locus: { component?, pin?, net? }, nextAction? }], checked: { components, nets, pins } }. `ok` is true when there are zero errors. Diagnostics use the same shape as kernelCAD geometry diagnostics, sorted error → warn → info, deterministically.
| Parameter | Type | Description |
|---|---|---|
| ignore | array | Rule codes to suppress, e.g. ["erc.net-single-pin"]. |
| schematic * | object | |
| treatUnspecifiedAsPassive | boolean | When true, an "unspecified" pin counts as passive for the input-not-driven check. |
{
"name": "erc_run",
"title": "Run Electrical Rule Check",
"description": "Run an electrical rule check (ERC) on a schematic and return structured diagnostics — the KiCad ERC step, over MCP.\n\nCHECKS: duplicate reference designators; net endpoints naming an unknown component or pin; unconnected pins (ignoring hidden power pins and explicit no-connects); single-pin nets; driver conflicts (two outputs on one net); power_in pins with no power_out source; input pins with no driver; no-connect markers on connected or non-existent pins; incomplete differential pairs; empty nets.\n\nINPUT: `schematic` (same shape as netlist_export), `ignore` (optional array of rule codes to suppress, e.g. [\"erc.net-single-pin\"]), `treatUnspecifiedAsPassive` (optional; when true an \"unspecified\" pin counts as passive for the input-not-driven check).\n\nOUTPUT: { ok, counts: { error, warn, info }, diagnostics: [{ code, severity, message, hint?, locus: { component?, pin?, net? }, nextAction? }], checked: { components, nets, pins } }. `ok` is true when there are zero errors. Diagnostics use the same shape as kernelCAD geometry diagnostics, sorted error → warn → info, deterministically.",
"inputSchema": {
"type": "object",
"required": [
"schematic"
],
"properties": {
"ignore": {
"type": "array",
"items": {
"type": "string"
},
"description": "Rule codes to suppress, e.g. [\"erc.net-single-pin\"]."
},
"schematic": {
"type": "object",
"required": [
"components",
"nets"
],
"properties": {
"nets": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"endpoints"
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "Net name. Repeating a name merges the nets (net labels on several sheets)."
},
"netClass": {
"type": "string",
"description": "Net class, e.g. \"Default\", \"Power\", \"HighSpeedDiff\"."
},
"endpoints": {
"type": "array",
"items": {
"type": "object",
"required": [
"component",
"pin"
],
"properties": {
"pin": {
"type": "string",
"description": "Pin number on that component."
},
"component": {
"type": "string",
"description": "Reference designator of the component."
}
}
},
"description": "Pins electrically common on this net."
},
"diffPairPartner": {
"type": "string",
"description": "The other member of this differential pair, when declared."
}
}
},
"description": "Nets (electrically common pin sets)."
},
"title": {
"type": "string",
"description": "Optional schematic title, used in diagnostics context."
},
"components": {
"type": "array",
"items": {
"type": "object",
"required": [
"reference",
"pins"
],
"properties": {
"dnp": {
"type": "boolean",
"description": "Do-not-populate marker."
},
"pins": {
"type": "array",
"items": {
"type": "object",
"required": [
"pin"
],
"properties": {
"pin": {
"type": "string",
"minLength": 1,
"description": "Pin number/name, e.g. \"1\", \"A3\", \"GND\"."
},
"pinType": {
"enum": [
"input",
"output",
"bidirectional",
"tri_state",
"passive",
"free",
"unspecified",
"power_in",
"power_out",
"open_collector",
"open_emitter",
"no_connect"
],
"type": "string",
"description": "Electrical type (KiCad pin electrical types). Defaults to \"unspecified\"."
},
"hiddenPower": {
"type": "boolean",
"description": "True for a hidden power pin implicitly connected by the symbol. ERC does not report it unconnected."
},
"pinFunction": {
"type": "string",
"description": "Pin function label, e.g. \"VCC\", \"RESET\"."
}
}
},
"description": "Pins declared by the library part. A component with no pins cannot appear in a netlist."
},
"unit": {
"type": "integer",
"minimum": 1,
"description": "Unit index (1-based) for multi-unit parts."
},
"value": {
"type": "string",
"description": "Value, e.g. \"10k\", \"STM32G0\", \"100nF\"."
},
"libpart": {
"type": "string",
"description": "Library part id, e.g. \"Device:R\"."
},
"footprint": {
"type": "string",
"description": "Footprint id from the footprint library, e.g. \"Package_SO:SOIC-8_3.9x4.9mm_P1.27mm\"."
},
"reference": {
"type": "string",
"minLength": 1,
"description": "Reference designator, e.g. \"R1\", \"U3\", \"J2\". Must be unique."
}
}
},
"description": "Placed component instances."
},
"noConnects": {
"type": "array",
"items": {
"type": "object",
"required": [
"component",
"pin"
],
"properties": {
"pin": {
"type": "string"
},
"reason": {
"type": "string",
"description": "Optional free-text reason carried from the schematic."
},
"component": {
"type": "string"
}
}
},
"description": "Explicit no-connect markers — pins deliberately left unused."
}
}
},
"treatUnspecifiedAsPassive": {
"type": "boolean",
"description": "When true, an \"unspecified\" pin counts as passive for the input-not-driven check."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Run Electrical Rule Check",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Search the public kernelCAD asset catalogue of published models. This is not find_part (screws, bearings, NEMA). Read-only. Anonymous callers are allowed. Do not send an API key. Use source:"library" for the free built-in model library. Search its titles, tags or kit IDs, and download editable .kcad.ts from downloads.source. Library slugs are kit/id. For community projects use source:"community". With no source, an empty or unavailable community search falls back to the library for supported filters. Library supports q, category (kit or manufacturing), tags, license, triangle bounds, kit, limit and cursor. Its default order is kit/id; use sort:"triangles" for descending complexity. Rig, IK, latest and remixed are community metadata. For category:"kit", usage gives explicit evaluate_script and render_preview options for visual scene geometry. These skip mechanism checks and leave mechanical behavior unverified. Keep the checks enabled for manufacturing or engineering verification. Each community row has slug, title, license (SPDX, always present), category, tags, kit, stats, has_rig, has_ik, ik_type, remix_count and thumbnail_url. UNITS: stats.size_m is {x, y, z} in metres. Y is up. stats.origin_y is the model origin height in metres. stats.triangles is the triangle count. RIG: has_rig means the asset has named moving parts. Pass rig:true to keep only those. get_asset returns rig as { <name>: { type: "rotate" or "slide", axis: "x"|"y"|"z" (local), range: [min, max] (degrees for rotate, metres for slide), node } }. has_ik / ik_type mark an inverse-kinematics target. ik is "any", "arm" or "legs". FILTERS, all optional: q (title, tags and description), category, tags (every listed tag must match), license (SPDX id), min_triangles, max_triangles, rig (true = moving parts only), ik ("any"|"arm"|"legs"), kit, sort ("latest"|"triangles"|"remixed"), cursor (next_cursor from the previous page), limit (1-100, default 24). Only public, gallery-listed assets with a redistributable licence are returned. Use get_asset(slug) for params, presets and the rig. Use get_asset_pack(slug) for a short-lived signed zip URL.
| Parameter | Type | Description |
|---|---|---|
| q | string | Words matched against title, tags and description. |
| ik | string | Inverse-kinematics filter. "any" is any IK target; "arm" and "legs" match ik_type. |
| kit | string | Exact kit id. |
| rig | boolean | true = only assets with named moving parts (has_rig). |
| sort | string | latest (default), triangles, or remixed. |
| tags | array | Every tag must be present on the asset. |
| limit | integer | Page size, 1-100. Default 24. |
| cursor | string | next_cursor from the previous page. Must be used with the same sort. |
| source | string | library = downloadable built-in models; community = published projects. |
| license | string | SPDX licence id. Every row also carries license. |
| category | string | Exact category label, e.g. "mechanism". |
| max_triangles | integer | Keep assets with at most this many triangles. |
| min_triangles | integer | Keep assets with at least this many triangles. |
{
"name": "search_assets",
"title": "Search Catalogue Assets",
"description": "Search the public kernelCAD asset catalogue of published models. This is not find_part (screws, bearings, NEMA). Read-only. Anonymous callers are allowed. Do not send an API key.\nUse source:\"library\" for the free built-in model library. Search its titles, tags or kit IDs, and download editable .kcad.ts from downloads.source. Library slugs are kit/id. For community projects use source:\"community\". With no source, an empty or unavailable community search falls back to the library for supported filters.\nLibrary supports q, category (kit or manufacturing), tags, license, triangle bounds, kit, limit and cursor. Its default order is kit/id; use sort:\"triangles\" for descending complexity. Rig, IK, latest and remixed are community metadata.\nFor category:\"kit\", usage gives explicit evaluate_script and render_preview options for visual scene geometry. These skip mechanism checks and leave mechanical behavior unverified. Keep the checks enabled for manufacturing or engineering verification.\nEach community row has slug, title, license (SPDX, always present), category, tags, kit, stats, has_rig, has_ik, ik_type, remix_count and thumbnail_url.\nUNITS: stats.size_m is {x, y, z} in metres. Y is up. stats.origin_y is the model origin height in metres. stats.triangles is the triangle count.\nRIG: has_rig means the asset has named moving parts. Pass rig:true to keep only those. get_asset returns rig as { <name>: { type: \"rotate\" or \"slide\", axis: \"x\"|\"y\"|\"z\" (local), range: [min, max] (degrees for rotate, metres for slide), node } }. has_ik / ik_type mark an inverse-kinematics target. ik is \"any\", \"arm\" or \"legs\".\nFILTERS, all optional: q (title, tags and description), category, tags (every listed tag must match), license (SPDX id), min_triangles, max_triangles, rig (true = moving parts only), ik (\"any\"|\"arm\"|\"legs\"), kit, sort (\"latest\"|\"triangles\"|\"remixed\"), cursor (next_cursor from the previous page), limit (1-100, default 24).\nOnly public, gallery-listed assets with a redistributable licence are returned. Use get_asset(slug) for params, presets and the rig. Use get_asset_pack(slug) for a short-lived signed zip URL.",
"inputSchema": {
"type": "object",
"properties": {
"q": {
"type": "string",
"maxLength": 200,
"description": "Words matched against title, tags and description."
},
"ik": {
"enum": [
"any",
"arm",
"legs"
],
"type": "string",
"description": "Inverse-kinematics filter. \"any\" is any IK target; \"arm\" and \"legs\" match ik_type."
},
"kit": {
"type": "string",
"maxLength": 64,
"description": "Exact kit id."
},
"rig": {
"type": "boolean",
"description": "true = only assets with named moving parts (has_rig)."
},
"sort": {
"enum": [
"latest",
"triangles",
"remixed"
],
"type": "string",
"description": "latest (default), triangles, or remixed."
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 16,
"description": "Every tag must be present on the asset."
},
"limit": {
"type": "integer",
"maximum": 100,
"minimum": 1,
"description": "Page size, 1-100. Default 24."
},
"cursor": {
"type": "string",
"description": "next_cursor from the previous page. Must be used with the same sort."
},
"source": {
"enum": [
"library",
"community"
],
"type": "string",
"description": "library = downloadable built-in models; community = published projects."
},
"license": {
"enum": [
"CC-BY-4.0",
"CC-BY-SA-4.0",
"CC-BY-NC-4.0",
"CC-BY-NC-SA-4.0",
"CC0-1.0",
"MIT",
"BSD-2-Clause",
"BSD-3-Clause",
"Apache-2.0",
"MPL-2.0",
"Unlicense"
],
"type": "string",
"description": "SPDX licence id. Every row also carries license."
},
"category": {
"type": "string",
"maxLength": 64,
"description": "Exact category label, e.g. \"mechanism\"."
},
"max_triangles": {
"type": "integer",
"maximum": 1000000,
"minimum": 0,
"description": "Keep assets with at most this many triangles."
},
"min_triangles": {
"type": "integer",
"maximum": 1000000,
"minimum": 0,
"description": "Keep assets with at least this many triangles."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Search Catalogue Assets",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}Fetch one public catalogue asset by slug. Read-only. No sign-in and no API key. A built-in kit/id returns the free editable downloads.source (.kcad.ts), studio_url, thumbnail_url, license, and published params and presets. params lists each declared control with its name, type, default, label, units, numeric range or choices. Dependent choicesBy maps constrain valid combinations. Download the source with plain GET and use its declared parameter names when editing. Visual scene kits include usage.evaluate_script and usage.render_preview options to build or preview geometry without mechanism checks. This does not verify mechanical behavior. Manufacturing assets retain the default checks. For community slugs, returns the search fields plus params (the knob schema), presets, rig, and public download paths. Parameter values use each control's declared unit. Geometry stats.size_m and stats.origin_y are metres, Y up. RIG: each rig entry is a named pivot. type "rotate" has range in degrees; type "slide" has range in metres; axis is the pivot's local x, y or z. license is the SPDX id to keep with the asset. The download paths are public catalogue routes. Call get_asset_pack for a short-lived signed zip URL. Do not send an API key.
| Parameter | Type | Description |
|---|---|---|
| slug * | string | Catalogue slug from search_assets. |
{
"name": "get_asset",
"title": "Get Catalogue Asset",
"description": "Fetch one public catalogue asset by slug. Read-only. No sign-in and no API key.\nA built-in kit/id returns the free editable downloads.source (.kcad.ts), studio_url, thumbnail_url, license, and published params and presets. params lists each declared control with its name, type, default, label, units, numeric range or choices. Dependent choicesBy maps constrain valid combinations. Download the source with plain GET and use its declared parameter names when editing.\nVisual scene kits include usage.evaluate_script and usage.render_preview options to build or preview geometry without mechanism checks. This does not verify mechanical behavior. Manufacturing assets retain the default checks.\nFor community slugs, returns the search fields plus params (the knob schema), presets, rig, and public download paths.\nParameter values use each control's declared unit. Geometry stats.size_m and stats.origin_y are metres, Y up.\nRIG: each rig entry is a named pivot. type \"rotate\" has range in degrees; type \"slide\" has range in metres; axis is the pivot's local x, y or z.\nlicense is the SPDX id to keep with the asset. The download paths are public catalogue routes. Call get_asset_pack for a short-lived signed zip URL. Do not send an API key.",
"inputSchema": {
"type": "object",
"required": [
"slug"
],
"properties": {
"slug": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Catalogue slug from search_assets."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Get Catalogue Asset",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}Return a short-lived signed URL for a catalogue asset zip (mesh, params, licence). Read-only. No sign-in. The URL is already signed. Fetch it with GET. Do not send an API key or an Authorization header. It expires quickly; read expires_at. Share download_url with the user. Units in the pack follow the catalogue: metres, Y is up. A rig, when present, names pivots of type rotate (degrees) or slide (metres). If the publisher stored no pack, the result is { ok: false, error: "not_stored" }.
| Parameter | Type | Description |
|---|---|---|
| slug * | string | Catalogue slug from search_assets or get_asset. |
{
"name": "get_asset_pack",
"title": "Get Catalogue Asset Pack",
"description": "Return a short-lived signed URL for a catalogue asset zip (mesh, params, licence). Read-only. No sign-in.\nThe URL is already signed. Fetch it with GET. Do not send an API key or an Authorization header. It expires quickly; read expires_at. Share download_url with the user.\nUnits in the pack follow the catalogue: metres, Y is up. A rig, when present, names pivots of type rotate (degrees) or slide (metres).\nIf the publisher stored no pack, the result is { ok: false, error: \"not_stored\" }.",
"inputSchema": {
"type": "object",
"required": [
"slug"
],
"properties": {
"slug": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Catalogue slug from search_assets or get_asset."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Get Catalogue Asset Pack",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}Run a script and check the built model against its declared requirements. A full result has buildOk for geometry availability and ok for overall acceptance: a failed or not-evaluated requirement makes ok:false while retaining built geometry for inspection. Full local builds return viewerUrl: a live Studio link reused and updated on later full builds in the same MCP process. Hosted builds return viewerMode: hosted and viewerHint pointing to open_in_studio; they do not start a loopback viewer. Full evaluations return step evidence: build validity, volume and before/after local PNG paths in one shared iso frame. Snapshots require PW_CDP_URL for an existing browser; unavailable captures report an explicit error. Run a kernelCAD .kcad.ts script and report pass/fail + feature count + diagnostics + sceneSummary (BREP validity, volume in mm³, face count, bounding size in mm). When ok is false, refuse is the first error (refuse.code, refuse.message, refuse.try) so the next edit can target it. When the scene is assembly-built (assembly().part(...) → .model()/.solvedModel()), also returns a parts summary { count, names } AND runs the mechanism-truth gate by default: the `mechanism` field reports real/broken/unverified and a broken mechanism (disconnected components / mechanism.orphan-part, self-collision, fastened drift, dof-mismatch) makes ok:false with the failures in diagnostics. A mate connector more than 6 mm outside the bounding box of its part and of every part fastened to it (assembly.mechanical.connector-not-in-solid, the same error review_cad reports) also makes mechanism `broken` and ok:false, preserving the diagnostic — a mechanism (any mate or joint) needs every part linked by connectors + mates/joints (axis+revolute for shafts/hinges/gears; frame+fastened for rigid; or arm.revolute/.prismatic/.ball/.fixed). A plain multi-part assembly with no mates (base + lid, print layout) is independent bodies and passes. Pass { skip_mechanism_check: true } to opt out (e.g. a deliberately free part next to a mechanism). An animation or drive on a fastened joint (mechanism.motion-on-fixed-joint) is broken: animate a revolute/prismatic mate pose. For a model with moving joints or motion intent, `mechanismSummary.statement` is one plain line: "Motion checked: ..." names what ran; "Motion not checked: ..." is NOT a pass — never call that mechanism working. If the joint-range collision sweep exceeds its work budget, `mechanism.unverified-budget-exceeded` appears as a warning in diagnostics and `mechanismSummary.skipped` explains the skip. Rest-pose body continuity, mate contact and interpenetration still run; a rest-pose error makes the mechanism broken, while a clean but skipped sweep remains unverified. Every union() is checked too (no opt-out): union.disconnected (the union is several separate solids — a floating operand) and union.member-overlap (two operands that each carry their own .finish()/.material(), the same one, share > 1 mm³ — cut members to fit, e.g. a cross tube between rails is span minus two rail widths) make ok:false. Pass either { file: "<path>" } or { code: "<inline source>" }. Set { dry_run: true } for fast validation while iterating: transpile + capture + capture-light checks without building solids, DFM gates, or meshing — milliseconds instead of seconds (100x+ on boolean/fillet-heavy scripts). A dry run catches script throws, capture-time API misuse, and assembly validity-gate failures, but NOT lowering failures or dfmSpec diagnostics; it leaves the active session untouched, so finish with a full (non-dry) evaluate_script before using session-dependent tools. To show a measurement in the 3D viewer (e.g. hole spacing), declare it in the script with shape.dimension({ kind: "linear", from, to, label }); a full evaluate lists them as dimensions: [{ text, kind, source }], and a shared /p link with ?dims=1 forces them on. A full evaluation updates the active MCP session and viewer state and keeps temporary step evidence; {
| Parameter | Type | Description |
|---|---|---|
| code | string | Inline kernelCAD script source. |
| file | string | Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| intent | string | 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. |
| kernel | string | Solid-modeling kernel. Default 'occt' (OpenCascade); opt-in 'smlib' uses guarded candidates with explicit OCCT fallback diagnostics. |
| dry_run | boolean | Fast validation only: skip solid build, DFM gates, and meshing. Does not set or clear the active session. |
| baseline | array | The `selections` of an earlier evaluation of this model. A selector that now binds to a different face or edge is reported as selector.binding-changed (warning), one whose entity only moved or resized as selector.binding-moved (info). Defaults to the previous evaluation of the same `file`. |
| requirements | array | Call-time external requirements ([{ name, predicate }]) measured in the same `requirements` ledger, tagged source: 'external' and never persisted. The predicate is the serializable form of require(): { metric: clearance | distance | mass | volume | bbox | centerOfMass | count | innerLoops | angle | … |
| skip_mechanism_check | boolean | Opt out of the default mechanism-truth gate. By default a full evaluation of an assembly-built scene runs checkMechanismTruth and returns a `mechanism` verdict (real/broken/unverified); a broken mechanism makes ok:false. A budget-skipped sweep still runs rest-pose checks and reports a typed warning.… |
{
"name": "evaluate_script",
"title": "Evaluate CAD Script",
"description": "Run a script and check the built model against its declared requirements. A full result has buildOk for geometry availability and ok for overall acceptance: a failed or not-evaluated requirement makes ok:false while retaining built geometry for inspection. Full local builds return viewerUrl: a live Studio link reused and updated on later full builds in the same MCP process. Hosted builds return viewerMode: hosted and viewerHint pointing to open_in_studio; they do not start a loopback viewer. Full evaluations return step evidence: build validity, volume and before/after local PNG paths in one shared iso frame. Snapshots require PW_CDP_URL for an existing browser; unavailable captures report an explicit error. Run a kernelCAD .kcad.ts script and report pass/fail + feature count + diagnostics + sceneSummary (BREP validity, volume in mm³, face count, bounding size in mm). When ok is false, refuse is the first error (refuse.code, refuse.message, refuse.try) so the next edit can target it. When the scene is assembly-built (assembly().part(...) → .model()/.solvedModel()), also returns a parts summary { count, names } AND runs the mechanism-truth gate by default: the `mechanism` field reports real/broken/unverified and a broken mechanism (disconnected components / mechanism.orphan-part, self-collision, fastened drift, dof-mismatch) makes ok:false with the failures in diagnostics. A mate connector more than 6 mm outside the bounding box of its part and of every part fastened to it (assembly.mechanical.connector-not-in-solid, the same error review_cad reports) also makes mechanism `broken` and ok:false, preserving the diagnostic — a mechanism (any mate or joint) needs every part linked by connectors + mates/joints (axis+revolute for shafts/hinges/gears; frame+fastened for rigid; or arm.revolute/.prismatic/.ball/.fixed). A plain multi-part assembly with no mates (base + lid, print layout) is independent bodies and passes. Pass { skip_mechanism_check: true } to opt out (e.g. a deliberately free part next to a mechanism). An animation or drive on a fastened joint (mechanism.motion-on-fixed-joint) is broken: animate a revolute/prismatic mate pose. For a model with moving joints or motion intent, `mechanismSummary.statement` is one plain line: \"Motion checked: ...\" names what ran; \"Motion not checked: ...\" is NOT a pass — never call that mechanism working. If the joint-range collision sweep exceeds its work budget, `mechanism.unverified-budget-exceeded` appears as a warning in diagnostics and `mechanismSummary.skipped` explains the skip. Rest-pose body continuity, mate contact and interpenetration still run; a rest-pose error makes the mechanism broken, while a clean but skipped sweep remains unverified. Every union() is checked too (no opt-out): union.disconnected (the union is several separate solids — a floating operand) and union.member-overlap (two operands that each carry their own .finish()/.material(), the same one, share > 1 mm³ — cut members to fit, e.g. a cross tube between rails is span minus two rail widths) make ok:false. Pass either { file: \"<path>\" } or { code: \"<inline source>\" }. Set { dry_run: true } for fast validation while iterating: transpile + capture + capture-light checks without building solids, DFM gates, or meshing — milliseconds instead of seconds (100x+ on boolean/fillet-heavy scripts). A dry run catches script throws, capture-time API misuse, and assembly validity-gate failures, but NOT lowering failures or dfmSpec diagnostics; it leaves the active session untouched, so finish with a full (non-dry) evaluate_script before using session-dependent tools. To show a measurement in the 3D viewer (e.g. hole spacing), declare it in the script with shape.dimension({ kind: \"linear\", from, to, label }); a full evaluate lists them as dimensions: [{ text, kind, source }], and a shared /p link with ?dims=1 forces them on. A full evaluation updates the active MCP session and viewer state and keeps temporary step evidence; { ",
"inputSchema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Inline kernelCAD script source."
},
"file": {
"type": "string",
"description": "Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"intent": {
"type": "string",
"maxLength": 2000,
"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."
},
"kernel": {
"enum": [
"occt",
"smlib"
],
"type": "string",
"description": "Solid-modeling kernel. Default 'occt' (OpenCascade); opt-in 'smlib' uses guarded candidates with explicit OCCT fallback diagnostics."
},
"dry_run": {
"type": "boolean",
"description": "Fast validation only: skip solid build, DFM gates, and meshing. Does not set or clear the active session."
},
"baseline": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"description": "The `selections` of an earlier evaluation of this model. A selector that now binds to a different face or edge is reported as selector.binding-changed (warning), one whose entity only moved or resized as selector.binding-moved (info). Defaults to the previous evaluation of the same `file`."
},
"requirements": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"description": "Call-time external requirements ([{ name, predicate }]) measured in the same `requirements` ledger, tagged source: 'external' and never persisted. The predicate is the serializable form of require(): { metric: clearance | distance | mass | volume | bbox | centerOfMass | count | innerLoops | angle | concentric | coplanar, a?, b?, op: gte | lte | eq | between | within, limit, tolerance?, density? }. Operands are { kind: body | faces | edges | part, ref: <feature id/name or part name>, query? }."
},
"skip_mechanism_check": {
"type": "boolean",
"description": "Opt out of the default mechanism-truth gate. By default a full evaluation of an assembly-built scene runs checkMechanismTruth and returns a `mechanism` verdict (real/broken/unverified); a broken mechanism makes ok:false. A budget-skipped sweep still runs rest-pose checks and reports a typed warning. Set true to skip the mechanism gate entirely (no `mechanism` field, no cost). Ignored for dry_run and non-assembly scripts."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Evaluate CAD Script",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}
}Use this when you need to see exactly what changed between two script versions. Structured geometric delta between two versions of a kernelCAD script — a baseline ({ base_file } or { base_code }) and a revision ({ file } or { code }). Returns agent-readable JSON: per-part added/removed/renamed/changed (volume mm³ + exact bbox deltas, numbers matching inspect({ of: 'part-stats' })), total interference-volume delta with per-pair detail, mate-graph changes (added/removed/changed mates incl. type, connectors, pose, limits, coupleMates coupling), and param changes (value/min/max). Single-shape scripts diff as one "(root)" pseudo-part; a `return [a, b]` multi-body script diffs per body as "body[0]", "body[1]". An error that still leaves geometry (e.g. a skipped fillet) is listed under base/revised.errors beside the diff. Use after editing a script to verify exactly what changed physically before re-rendering. On a hosted server pass both versions inline: { base_code: 'return box(10, 10, 10);', code: 'return box(10, 10, 12);' } (base_code/old_code/before and revised_code/new_code/after are accepted as aliases). Read-only — never touches the active session.
| Parameter | Type | Description |
|---|---|---|
| code | string | Revised (after) script — inline source. One of file / code is required. |
| file | string | Revised (after) script — path to a .kcad.ts file. Local servers only. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| base_code | string | Baseline (before) script — inline source. One of base_file / base_code is required. |
| base_file | string | Baseline (before) script — path to a .kcad.ts file. Local servers only. |
{
"name": "diff_scripts",
"title": "Diff CAD Scripts",
"description": "Use this when you need to see exactly what changed between two script versions. Structured geometric delta between two versions of a kernelCAD script — a baseline ({ base_file } or { base_code }) and a revision ({ file } or { code }). Returns agent-readable JSON: per-part added/removed/renamed/changed (volume mm³ + exact bbox deltas, numbers matching inspect({ of: 'part-stats' })), total interference-volume delta with per-pair detail, mate-graph changes (added/removed/changed mates incl. type, connectors, pose, limits, coupleMates coupling), and param changes (value/min/max). Single-shape scripts diff as one \"(root)\" pseudo-part; a `return [a, b]` multi-body script diffs per body as \"body[0]\", \"body[1]\". An error that still leaves geometry (e.g. a skipped fillet) is listed under base/revised.errors beside the diff. Use after editing a script to verify exactly what changed physically before re-rendering. On a hosted server pass both versions inline: { base_code: 'return box(10, 10, 10);', code: 'return box(10, 10, 12);' } (base_code/old_code/before and revised_code/new_code/after are accepted as aliases). Read-only — never touches the active session.",
"inputSchema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Revised (after) script — inline source. One of file / code is required."
},
"file": {
"type": "string",
"description": "Revised (after) script — path to a .kcad.ts file. Local servers only. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"base_code": {
"type": "string",
"description": "Baseline (before) script — inline source. One of base_file / base_code is required."
},
"base_file": {
"type": "string",
"description": "Baseline (before) script — path to a .kcad.ts file. Local servers only."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Diff CAD Scripts",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to read facts about a model. One reader, selected by `of`: - 'assembly' — physical assembly inventory (parts, bboxes, connectors, mates, disconnected solids). - 'robot' — URDF/SDFormat export preview (links, joints, planning groups, end-effectors, issues). - 'step' — inspect an imported STEP file: solid tree, exact bbox/volume, analytic planar/cylindrical faces, hole axes, and conservative hole/pocket/boss/slot/round candidates with per-feature status/confidence. - 'brep' — the same recognition report for a native OCCT BREP file, including BRepCheck validity per solid. - 'shape' — volume / surfaceArea / bbox for one feature ({ feature_id? }). - 'mass' — mass, centre of mass, centroidal inertia tensor (inertia6 + 3x3 inertiaMatrix), principalMoments/principalAxes, symmetry flags, and optionally the radius of gyration about an arbitrary axis ({ feature_id?, density?, gyration_axis? }); density in kg/m^3, defaults to 1000 (water). - 'features' — features captured by the script (kind, id, params, transforms, suppression). - 'assemblies' — assembly intent (assemblies, parts, connectors, joints). - 'topology' — canonical face names + edge count for a feature ({ feature_id? }). - 'edges' — edges of a shape with optional EdgeQuery ({ feature_id?, query? }); returns @kc[...] refs. - 'face-edges' — boundary edges of a named canonical face ({ feature_id?, face_name }). - 'faces' — faces of a shape with optional FaceQuery ({ feature_id?, query? }); returns @kc[...] refs. - 'face-labels' — user-applied labels visible in the script. - 'mates' — declared mates and limits. code/file captures the supplied source atomically. Optional query:{poses} adds solution from the mate solver and makes ok reflect convergence. evaluationEvidence binds exact source bytes and query inputs. - 'constraints' — sketch constraints captured by the script. - 'part-stats' — bundled parts-catalog statistics. - 'bend-table' — sheet-metal bend table for a flattened pattern. - 'params' — declared model parameters. - 'part-categories' — top-level part-catalog categories available in the bundled (and configured remote) catalog. - 'part-families' — part families within a category ({ category? }); count + exemplar ids per family. - 'bom' — bill of materials ({ assembly? }): one row per distinct part (grouped by geometry/catalog identity, not name) with real instance quantity, kind ('fabricated'|'purchased'), material, density, per-unit and total mass, bbox, a fabrication process (`process` + `processSource`), declared `stock` (bar/plate/blank/filament, mm) when `asm.part` set it, catalog provenance for purchased parts, and totals; `bom.*` diagnostics flag rows with no density source or missing catalog vendor info instead of guessing. - 'section' — numeric cross-section probe of a shape: area, perimeter, loop/hole counts, 2D bbox at a plane ({ feature_id?, plane | at+axis, stack?: { from, to, count, axis? } }). `stack` scans evenly spaced slices and returns `minAreaIndex`/`minAreaPosition` — use it to find the neck/thinnest cross-section along an axis. - 'continuity' — sampled G0/G1/G2 classification of shared edges ({ feature_id?, edges? }); returns the 9-station method, position/normal/curvature tolerances, edge-frame curvature comparability, worst sample, and explicitly marks G3/G4 as unmeasured. G2 describes the sampled BREP seam result, not the requested feature option. - 'curvature' — per-face Gaussian and mean curvature min/max/mean, inflections, spikes ({ feature_id?, faces?, spike_factor? }). - 'multi-material' — explicit material leaves shadowed by later attributed boolean descendants, with assembly-part rewrite templates; analyzes capture records and does not change mesh attribution. All params except `of` are subject-specific and forwarded verbatim. Most subjects accept { file | code }. Hosted: give the file as an https:// URL, a data: URI (base64, max 25 MB) or "asset:<id>" from request_upload (when the file is on the user's device).
| Parameter | Type | Description |
|---|---|---|
| at | number | of:'section' — single slice position along `axis` (mm). |
| of * | string | Which facts to read. |
| axis | string | of:'section' — normal axis for `at` / `stack` (default 'z'). |
| code | string | Inline kernelCAD script source. |
| file | string | Path to the subject file: .step/.stp for of:'step', .brep for of:'brep', or a .kcad.ts script for script-backed subjects. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. Hosted server: pass an https:// URL, a data: URI, or "asset:<id>" from … |
| edges | ["object","array","string"] | of:'continuity' — optional EdgeQuery or @kc[...] ref(s) limiting which shared edges are sampled. |
| faces | ["object","array","string"] | of:'curvature' — optional FaceQuery or @kc[...] ref(s) limiting which faces are sampled. |
| plane | ["string","object"] | of:'section' — section plane. Either a cardinal name string 'xy'|'xz'|'yz', { plane: 'xy'|'xz'|'yz', offset? }, or { origin: [x,y,z], normal: [nx,ny,nz] }. Omit to use `at`+`axis`. |
| query | object | of:'edges'|'faces' — optional EdgeQuery/FaceQuery filter. of:'mates' — optional { poses: { [mateName]: number | [number,number,number] } } to solve the same captured assembly and return solution. code/file binds mate inventory, limits and solution atomically to evaluationEvidence.source.sha256. A no… |
| stack | object | of:'section' — dense scan: `count` slices evenly spaced from `from` to `to` along `axis`; response reports minAreaIndex/minAreaPosition. |
{
"name": "inspect",
"title": "Inspect Model",
"description": "Use this when you need to read facts about a model. One reader, selected by `of`:\n- 'assembly' — physical assembly inventory (parts, bboxes, connectors, mates, disconnected solids).\n- 'robot' — URDF/SDFormat export preview (links, joints, planning groups, end-effectors, issues).\n- 'step' — inspect an imported STEP file: solid tree, exact bbox/volume, analytic planar/cylindrical faces, hole axes, and conservative hole/pocket/boss/slot/round candidates with per-feature status/confidence.\n- 'brep' — the same recognition report for a native OCCT BREP file, including BRepCheck validity per solid.\n- 'shape' — volume / surfaceArea / bbox for one feature ({ feature_id? }).\n- 'mass' — mass, centre of mass, centroidal inertia tensor (inertia6 + 3x3 inertiaMatrix), principalMoments/principalAxes, symmetry flags, and optionally the radius of gyration about an arbitrary axis ({ feature_id?, density?, gyration_axis? }); density in kg/m^3, defaults to 1000 (water).\n- 'features' — features captured by the script (kind, id, params, transforms, suppression).\n- 'assemblies' — assembly intent (assemblies, parts, connectors, joints).\n- 'topology' — canonical face names + edge count for a feature ({ feature_id? }).\n- 'edges' — edges of a shape with optional EdgeQuery ({ feature_id?, query? }); returns @kc[...] refs.\n- 'face-edges' — boundary edges of a named canonical face ({ feature_id?, face_name }).\n- 'faces' — faces of a shape with optional FaceQuery ({ feature_id?, query? }); returns @kc[...] refs.\n- 'face-labels' — user-applied labels visible in the script.\n- 'mates' — declared mates and limits. code/file captures the supplied source atomically. Optional query:{poses} adds solution from the mate solver and makes ok reflect convergence. evaluationEvidence binds exact source bytes and query inputs.\n- 'constraints' — sketch constraints captured by the script.\n- 'part-stats' — bundled parts-catalog statistics.\n- 'bend-table' — sheet-metal bend table for a flattened pattern.\n- 'params' — declared model parameters.\n- 'part-categories' — top-level part-catalog categories available in the bundled (and configured remote) catalog.\n- 'part-families' — part families within a category ({ category? }); count + exemplar ids per family.\n- 'bom' — bill of materials ({ assembly? }): one row per distinct part (grouped by geometry/catalog identity, not name) with real instance quantity, kind ('fabricated'|'purchased'), material, density, per-unit and total mass, bbox, a fabrication process (`process` + `processSource`), declared `stock` (bar/plate/blank/filament, mm) when `asm.part` set it, catalog provenance for purchased parts, and totals; `bom.*` diagnostics flag rows with no density source or missing catalog vendor info instead of guessing.\n- 'section' — numeric cross-section probe of a shape: area, perimeter, loop/hole counts, 2D bbox at a plane ({ feature_id?, plane | at+axis, stack?: { from, to, count, axis? } }). `stack` scans evenly spaced slices and returns `minAreaIndex`/`minAreaPosition` — use it to find the neck/thinnest cross-section along an axis.\n- 'continuity' — sampled G0/G1/G2 classification of shared edges ({ feature_id?, edges? }); returns the 9-station method, position/normal/curvature tolerances, edge-frame curvature comparability, worst sample, and explicitly marks G3/G4 as unmeasured. G2 describes the sampled BREP seam result, not the requested feature option.\n- 'curvature' — per-face Gaussian and mean curvature min/max/mean, inflections, spikes ({ feature_id?, faces?, spike_factor? }).\n- 'multi-material' — explicit material leaves shadowed by later attributed boolean descendants, with assembly-part rewrite templates; analyzes capture records and does not change mesh attribution.\nAll params except `of` are subject-specific and forwarded verbatim. Most subjects accept { file | code }. Hosted: give the file as an https:// URL, a data: URI (base64, max 25 MB) or \"asset:<id>\" from request_upload (when the file is on the user's device).",
"inputSchema": {
"type": "object",
"required": [
"of"
],
"properties": {
"at": {
"type": "number",
"description": "of:'section' — single slice position along `axis` (mm)."
},
"of": {
"enum": [
"assembly",
"robot",
"step",
"brep",
"shape",
"mass",
"features",
"assemblies",
"topology",
"edges",
"face-edges",
"faces",
"face-labels",
"mates",
"constraints",
"part-stats",
"bend-table",
"params",
"part-categories",
"part-families",
"bom",
"section",
"continuity",
"curvature",
"multi-material"
],
"type": "string",
"description": "Which facts to read."
},
"axis": {
"enum": [
"x",
"y",
"z"
],
"type": "string",
"description": "of:'section' — normal axis for `at` / `stack` (default 'z')."
},
"code": {
"type": "string",
"description": "Inline kernelCAD script source."
},
"file": {
"type": "string",
"description": "Path to the subject file: .step/.stp for of:'step', .brep for of:'brep', or a .kcad.ts script for script-backed subjects. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. Hosted server: pass an https:// URL, a data: URI, or \"asset:<id>\" from request_upload — not a path on your machine."
},
"edges": {
"type": [
"object",
"array",
"string"
],
"description": "of:'continuity' — optional EdgeQuery or @kc[...] ref(s) limiting which shared edges are sampled."
},
"faces": {
"type": [
"object",
"array",
"string"
],
"description": "of:'curvature' — optional FaceQuery or @kc[...] ref(s) limiting which faces are sampled."
},
"plane": {
"type": [
"string",
"object"
],
"description": "of:'section' — section plane. Either a cardinal name string 'xy'|'xz'|'yz', { plane: 'xy'|'xz'|'yz', offset? }, or { origin: [x,y,z], normal: [nx,ny,nz] }. Omit to use `at`+`axis`."
},
"query": {
"type": "object",
"description": "of:'edges'|'faces' — optional EdgeQuery/FaceQuery filter. of:'mates' — optional { poses: { [mateName]: number | [number,number,number] } } to solve the same captured assembly and return solution. code/file binds mate inventory, limits and solution atomically to evaluationEvidence.source.sha256. A non-converging solution makes ok:false."
},
"stack": {
"type": "object",
"required": [
"from",
"to",
"count"
],
"properties": {
"to": {
"type": "number",
"description": "End position along the axis (mm)."
},
"axis": {
"enum": [
"x",
"y",
"z"
],
"type": "string",
"description": "Scan axis (default 'z')."
},
"from": {
"type": "number",
"description": "Start position along the axis (mm)."
},
"count": {
"type": "integer",
"description": "Number of evenly spaced slices (>= 1)."
}
},
"description": "of:'section' — dense scan: `count` slices evenly spaced from `from` to `to` along `axis`; response reports minAreaIndex/minAreaPosition."
},
"density": {
"type": "number",
"description": "of:'mass' — material density in kg/m^3 (steel 7850, aluminium 2700, ABS 1050). Defaults to 1000 (water); the response echoes the value used and flags when it was defaulted."
},
"assembly": {
"type": "string",
"description": "of:'assembly'|'robot'|'bom' — assembly name; defaults to the first captured assembly."
},
"category": {
"type": "string",
"description": "of:'part-families' — optional top-level category to filter families by."
},
"face_name": {
"enum": [
"top",
"bottom",
"left",
"right",
"front",
"back"
],
"type": "string",
"description": "of:'face-edges' — canonical face name (required for that subject)."
},
"feature_id": {
"type": "string",
"description": "of:'shape'|'mass'|'topology'|'edges'|'faces'|'face-edges'|'face-labels' — FeatureId; defaults to the last returned shape."
},
"spike_factor": {
"type": "number",
"description": "of:'curvature' — spike sensitivity as a multiple of the face's Gaussian stddev (default 6)."
},
"gyration_axis": {
"type": "object",
"required": [
"origin",
"direction"
],
"properties": {
"origin": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "A point on the axis, shape-local mm."
},
"direction": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "Axis direction; normalised internally, so it need not be a unit vector."
}
},
"description": "of:'mass' — optional axis in shape-local mm to report the radius of gyration about. Omit for centroidal quantities only; the result is density-independent and returned in mm."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Inspect Model",
"readOnlyHint": true,
"openWorldHint": true,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to check a design against a rule set. One verifier, selected by `check`: - 'assembly' — static assembly review ({ file | code }, or the session evaluate_script left): mate validator, default-pose interference, joint topology, mechanical plausibility. ok:false with `blocking[]` exactly when review_cad's blocking rules fire on these findings; review_cad also sweeps joint ranges and runs physics. - 'urdf' — structural validity of a .urdf file ({ urdf_path }). - 'dfm' — print-readiness gates declared by dfmSpec() ({ file | code }). - 'dfm-preflight' — sheet-metal flat pattern vs a job-shop's ordering rules ({ vendor, material, thickness_in|thickness_mm, ... }). Returns the vendor's catalog source pages as `sources`; when `disclosure` is present, show it with those links. - 'assembly-path' — continuous straight-line removal of each assembly part along ±X/±Y/±Z and optional world-space directions. Returns valid directions, blocking parts and one of three states (removable / blocked / unknown); sequence peels the directional blocking graph and reverses it into a build sequence with a model stamp. Fastened-mate and fixed-connect clusters become subassemblies: each is planned recursively inside and installed as one unit at the top level (`Step.subassembly`). Remaining valid orders use deterministic heuristics (subassemblies first, outside-in, fewest reorientations, fewest tool changes); stuck sets get a budgeted blocking-reduction partition and a sampling fallback whose paths are labelled found-by-search, never proven. A fastener with a fastened-mate `fastener` declaration (axis, pitch, optional tool envelope) is tested along its helical path and reported `motion: helical`; a press/snap `fit` declaration becomes a `requires-force` step, never simulated. A modelled driver/socket/hex-key envelope swept along the approach axis adds `toolBlocked` { fastener, blockers } and a failing S2 ledger entry; unmodelled tools add nothing. Threaded fasteners without metadata stay unknown: non-straight-path. `stability: true` adds an approximate P3 support check at each build step: each part's mesh centre of mass must project inside the support polygon of its contacts with already-stable parts (declared or inferred base/fixture under `gravity`, default [0,0,-1]); unsupported parts become `needsHold` { part, reason, supports } and their steps carry `stability: 'needs-hold'`, while stable steps may carry `heldBy`. This is a projection, not gravity simulation, friction, tipping or fixture analysis. disassemblyOrder runs a deterministic greedy removal pass. Watertight mesh approximation, conservative contact, no rotation/mate/hardware certification. - 'swept-collision' — sweep declared joint range(s) and report colliding poses. - 'joint-range' — suggest revolute and prismatic mate limits from geometry. Each joint is swept alone from its authored pose, other mates held at their authored poses, until a non-exempt pair is within clearance_mm (default 0.3) or the finite search bound is reached. Exact BREP distance brackets the crossing and the reported stop is the clear side of that bracket, so the suggested limit keeps the requested clearance. Returns lower/upper stop, the limiting part pair, resolution, and status stop | no-stop | unknown. no-stop means no crossing was found at the sampled poses, not continuous proof that the interval is clear. Unknown (no finite bound, budget, or a failed measurement) is never reported as no-stop. The result includes a limits snippet to apply explicitly; the script is not rewritten. Mate neighbours and declared contact pairs are not stops. - 'reachable' — inverse-kinematics reachability for an end-effector ({ tip_link, target_position, ... }). - 'geometry-quality' — one solid body's BREP tiny faces and short edges (ids, locations, mm²/mm), plus sampled mirror symmetry about centroid XY/YZ/XZ and principal inertia planes ({ file | code, feature_id?, tiny_face_area_mm2?, tiny_face_relative?, short_edge
| Parameter | Type | Description |
|---|---|---|
| dxf | string | check:'dfm-preflight' — path to a DXF file. |
| code | string | Inline kernelCAD script source (same checks as `file`). |
| file | string | Path to a .kcad.ts script (assembly/dfm/dfm-preflight/swept-collision/joint-range/reachable/mounting-holes/load-capacity/static-hold/geometry-quality/edge-radius/requirements). Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| mode | string | check:'load-capacity' — 'beam' (default), 'stub', or 'fea' (solve the script's feaStudy: CalculiX + gmsh when installed, else the in-process voxel estimate). |
| pose | ["object","array"] | check:'static-hold' — explicit pose (joint name -> deg/mm) or array of poses; omit to sample a grid across the evaluated joint's range. |
| seed | object | check:'reachable' — numeric IK seed pose (joint name -> deg/mm). |
| step | number | check:'joint-range' — coarse step in the joint's units (default 5 degrees or 2 mm). A contact thinner than one step can be missed. no-stop means those sampled poses found no crossing, not a continuous proof. |
| check * | string | Which verification to run. Omit only when passing call-time `requirements`; then the requirements ledger is the verification. |
| edges | ["object","array","string"] | check:'edge-radius' — EdgeQuery or @kc[...] edge ref(s); intersected with faces. Query near sorts, it does not filter. |
| faces | ["object","array","string"] |
{
"name": "verify",
"title": "Verify Design",
"description": "Use this when you need to check a design against a rule set. One verifier, selected by `check`:\n- 'assembly' — static assembly review ({ file | code }, or the session evaluate_script left): mate validator, default-pose interference, joint topology, mechanical plausibility. ok:false with `blocking[]` exactly when review_cad's blocking rules fire on these findings; review_cad also sweeps joint ranges and runs physics.\n- 'urdf' — structural validity of a .urdf file ({ urdf_path }).\n- 'dfm' — print-readiness gates declared by dfmSpec() ({ file | code }).\n- 'dfm-preflight' — sheet-metal flat pattern vs a job-shop's ordering rules ({ vendor, material, thickness_in|thickness_mm, ... }). Returns the vendor's catalog source pages as `sources`; when `disclosure` is present, show it with those links.\n- 'assembly-path' — continuous straight-line removal of each assembly part along ±X/±Y/±Z and optional world-space directions. Returns valid directions, blocking parts and one of three states (removable / blocked / unknown); sequence peels the directional blocking graph and reverses it into a build sequence with a model stamp. Fastened-mate and fixed-connect clusters become subassemblies: each is planned recursively inside and installed as one unit at the top level (`Step.subassembly`). Remaining valid orders use deterministic heuristics (subassemblies first, outside-in, fewest reorientations, fewest tool changes); stuck sets get a budgeted blocking-reduction partition and a sampling fallback whose paths are labelled found-by-search, never proven. A fastener with a fastened-mate `fastener` declaration (axis, pitch, optional tool envelope) is tested along its helical path and reported `motion: helical`; a press/snap `fit` declaration becomes a `requires-force` step, never simulated. A modelled driver/socket/hex-key envelope swept along the approach axis adds `toolBlocked` { fastener, blockers } and a failing S2 ledger entry; unmodelled tools add nothing. Threaded fasteners without metadata stay unknown: non-straight-path. `stability: true` adds an approximate P3 support check at each build step: each part's mesh centre of mass must project inside the support polygon of its contacts with already-stable parts (declared or inferred base/fixture under `gravity`, default [0,0,-1]); unsupported parts become `needsHold` { part, reason, supports } and their steps carry `stability: 'needs-hold'`, while stable steps may carry `heldBy`. This is a projection, not gravity simulation, friction, tipping or fixture analysis. disassemblyOrder runs a deterministic greedy removal pass. Watertight mesh approximation, conservative contact, no rotation/mate/hardware certification.\n- 'swept-collision' — sweep declared joint range(s) and report colliding poses.\n- 'joint-range' — suggest revolute and prismatic mate limits from geometry. Each joint is swept alone from its authored pose, other mates held at their authored poses, until a non-exempt pair is within clearance_mm (default 0.3) or the finite search bound is reached. Exact BREP distance brackets the crossing and the reported stop is the clear side of that bracket, so the suggested limit keeps the requested clearance. Returns lower/upper stop, the limiting part pair, resolution, and status stop | no-stop | unknown. no-stop means no crossing was found at the sampled poses, not continuous proof that the interval is clear. Unknown (no finite bound, budget, or a failed measurement) is never reported as no-stop. The result includes a limits snippet to apply explicitly; the script is not rewritten. Mate neighbours and declared contact pairs are not stops.\n- 'reachable' — inverse-kinematics reachability for an end-effector ({ tip_link, target_position, ... }).\n- 'geometry-quality' — one solid body's BREP tiny faces and short edges (ids, locations, mm²/mm), plus sampled mirror symmetry about centroid XY/YZ/XZ and principal inertia planes ({ file | code, feature_id?, tiny_face_area_mm2?, tiny_face_relative?, short_edge",
"inputSchema": {
"type": "object",
"required": [
"check"
],
"properties": {
"dxf": {
"type": "string",
"description": "check:'dfm-preflight' — path to a DXF file."
},
"code": {
"type": "string",
"description": "Inline kernelCAD script source (same checks as `file`)."
},
"file": {
"type": "string",
"description": "Path to a .kcad.ts script (assembly/dfm/dfm-preflight/swept-collision/joint-range/reachable/mounting-holes/load-capacity/static-hold/geometry-quality/edge-radius/requirements). Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"mode": {
"enum": [
"stub",
"beam",
"fea"
],
"type": "string",
"description": "check:'load-capacity' — 'beam' (default), 'stub', or 'fea' (solve the script's feaStudy: CalculiX + gmsh when installed, else the in-process voxel estimate)."
},
"pose": {
"type": [
"object",
"array"
],
"description": "check:'static-hold' — explicit pose (joint name -> deg/mm) or array of poses; omit to sample a grid across the evaluated joint's range."
},
"seed": {
"type": "object",
"description": "check:'reachable' — numeric IK seed pose (joint name -> deg/mm)."
},
"step": {
"type": "number",
"description": "check:'joint-range' — coarse step in the joint's units (default 5 degrees or 2 mm). A contact thinner than one step can be missed. no-stop means those sampled poses found no crossing, not a continuous proof.",
"exclusiveMinimum": 0
},
"check": {
"enum": [
"assembly",
"urdf",
"dfm",
"dfm-preflight",
"swept-collision",
"joint-range",
"reachable",
"mounting-holes",
"load-capacity",
"static-hold",
"motion-load",
"fastener-installation",
"geometry-quality",
"assembly-path",
"edge-radius",
"physics",
"clearance-range",
"requirements"
],
"type": "string",
"description": "Which verification to run. Omit only when passing call-time `requirements`; then the requirements ledger is the verification."
},
"edges": {
"type": [
"object",
"array",
"string"
],
"description": "check:'edge-radius' — EdgeQuery or @kc[...] edge ref(s); intersected with faces. Query near sorts, it does not filter."
},
"faces": {
"type": [
"object",
"array",
"string"
],
"description": "check:'edge-radius' — FaceQuery or @kc[...] face ref(s); includes incident edges and fillets on selected faces."
},
"joint": {
"type": "string",
"description": "check:'swept-collision' — joint to sweep; omit to sweep every declared joint. check:'joint-range' — revolute or prismatic joint to measure; omit to measure every one. check:'static-hold' — joint to evaluate; omit to evaluate every joint with a declared actuator."
},
"loads": {
"type": "object",
"description": "check:'load-capacity' — partName -> { force?: [Fx,Fy,Fz] N, torque?: [Tx,Ty,Tz] N*m }."
},
"parts": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"minItems": 1,
"description": "check:'edge-radius' — explicit assembly part names (default all).",
"uniqueItems": true
},
"range": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "check:'swept-collision' — [lower, upper, step] in joint-native units."
},
"study": {
"type": "string",
"description": "check:'load-capacity' mode:'fea' — feaStudy name (default: the last declared one)."
},
"refine": {
"type": "boolean",
"description": "check:'load-capacity' mode:'fea' — one automatic finer pass (0.75x element size) when the stress is untrusted, inside the element budget (default true); false solves once at the study's meshSize."
},
"search": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"description": "check:'joint-range' — [min, max] search window in the joint's units. Overrides authored limits. A joint with no finite window is unknown, not clear."
},
"vendor": {
"type": "string",
"description": "check:'dfm-preflight' — vendor SKU (required for that check)."
},
"gravity": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "check:'static-hold' — gravity vector, m/s^2, world frame (default [0, 0, -9.81]). check:'assembly-path' with stability:true — gravity direction, world frame, magnitude ignored (default [0, 0, -1])."
},
"service": {
"enum": [
"laser",
"cnc-router",
"waterjet",
"bending"
],
"type": "string",
"description": "check:'dfm-preflight' — service."
},
"assembly": {
"type": "string",
"description": "Assembly name; defaults to the first captured assembly."
},
"fixtures": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"description": "check:'assembly-path' with stability:true — declared base/fixture part names, stable from step 1. Default: the lowest part(s) along gravity.",
"uniqueItems": true
},
"heatmaps": {
"type": "boolean",
"description": "check:'load-capacity' mode:'fea' — also render stress heatmap PNGs (default false)."
},
"material": {
"type": "string",
"description": "check:'dfm-preflight' — material SKU (required for that check)."
},
"sequence": {
"type": "boolean",
"description": "check:'assembly-path' — plan a build sequence { steps, model, unknown, search?, requiresForce?, toolBlocked?, needsHold? }. Fastened/fixed clusters become subassemblies planned inside and installed as one unit; steps carry the insertion direction (reverse removal), and may be motion: helical (declared fastener), requires-force (press/snap, not proven) or search. Stuck sets use a budgeted partition; non-straight paths found by sampling are labelled found-by-search and are not proven. Blocked and unknown parts are not reported as impossible."
},
"supports": {
"type": "object",
"description": "check:'motion-load' — mechanicalJoint name -> support part names to use instead of the declared supports (compare with / without a bushing)."
},
"tip_link": {
"type": "string",
"description": "check:'reachable' — end-effector part name (required for that check)."
},
"fasteners": {
"type": "array",
"items": {
"type": "object",
"required": [
"part",
"against"
],
"properties": {
"part": {
"type": "string",
"minLength": 1
},
"against": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"minItems": 1,
"uniqueItems": true
},
"engagement_part": {
"type": "string",
"minLength": 1
},
"max_protrusion_mm": {
"type": "number",
"minimum": 0
},
"min_engagement_mm": {
"type": "number",
"minimum": 0,
"description": "Declared geometric axial overlap minimum; no thread-strength claim."
}
},
"additionalProperties": false
},
"description": "check:'fastener-installation' — explicit named stations; empty means no coverage."
},
"materials": {
"type": "object",
"description": "check:'load-capacity' — partName -> material declaration."
},
"mesh_size": {
"type": "number",
"description": "check:'load-capacity' mode:'fea' — element size override, mm."
},
"sample_ms": {
"type": "number",
"description": "check:'motion-load' — timeline sample step, ms (default 20). Inertia peaks depend on it at keyframe velocity steps."
},
"stability": {
"type": "boolean",
"description": "check:'assembly-path' — run the approximate P3 static-stability pass on the sequence. Each part's closed-mesh volume centroid (uniform density) must project inside the convex hull of its contacts with already-stable parts. Unsupported parts become needsHold { part, reason, supports } and ok:false; a stable step may carry heldBy. Not a physics simulation."
},
"urdf_path": {
"type": "string",
"description": "check:'urdf' — path to the .urdf file."
},
"directions": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
},
"maxItems": 64,
"description": "check:'assembly-path' — additional nonzero world-space removal vectors; normalized and deduplicated."
},
"feature_id": {
"type": "string",
"description": "check:'geometry-quality' — body feature to measure; defaults to script return. check:'edge-radius' — lowered feature; default the returned model."
},
"resolution": {
"type": "number",
"description": "check:'joint-range' — bisection tolerance in the joint's units (default 0.1 degrees or 0.05 mm). The reported stop is the clear side of the final bracket.",
"exclusiveMinimum": 0
},
"motion_mode": {
"enum": [
"tracks",
"range",
"poses"
],
"type": "string",
"description": "check:'motion-load' — 'tracks' (default): along the animationView timeline with inertia; 'range': quasi-static grid over each driven joint's limits; 'poses': exactly motion_poses (a user-named pose is one entry)."
},
"work_budget": {
"type": "number",
"description": "check:'assembly-path' — positive finite per-call work allowance for mesh validation, acceleration builds and path checks. Default 8000000. Exhaustion remains unknown; job time and memory limits still apply.",
"exclusiveMinimum": 0
},
"clearance_mm": {
"type": "number",
"minimum": 0,
"description": "check:'joint-range' — surface clearance the suggested stop protects, mm (default 0.3)."
},
"motion_loads": {
"type": "array",
"items": {
"type": "object",
"required": [
"part",
"point",
"force"
],
"properties": {
"part": {
"type": "string"
},
"force": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
},
"point": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
},
"to_ms": {
"type": "number"
},
"from_ms": {
"type": "number"
}
}
},
"description": "check:'motion-load' — external forces: [{ part, point: [x,y,z] mm in the part's modeled frame, force: [Fx,Fy,Fz] N world, from_ms?, to_ms? }]."
},
"motion_poses": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"description": "check:'motion-load' motion_mode:'poses' — explicit mate poses, each an object of joint name -> value in degrees."
},
"quasi_static": {
"type": "boolean",
"description": "check:'motion-load' — drop velocity/acceleration terms (gravity and external loads only)."
},
"requirements": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"description": "Call-time external requirements ([{ name, predicate }]) measured in the same ledger as script require(), dfmSpec and feaStudy, tagged source: 'external' and never persisted. The predicate is the serializable form of require(): { metric: clearance | distance | mass | volume | bbox | centerOfMass | count | innerLoops | angle | concentric | coplanar, a?, b?, op: gte | lte | eq | between | within, limit, tolerance?, density? }. Operands are { kind: body | faces | edges | part, ref: <feature id/name or part name>, query? }. With `check` omitted the ledger is the whole verification; check 'requirements' is the explicit form."
},
"sweep_budget": {
"type": "number",
"minimum": 0,
"description": "check:'joint-range' — face-weighted exact BREP distance budget (default 40000). 0, or a probe that would pass the budget, returns unknown. Never a clear range."
},
"thickness_in": {
"type": "number",
"description": "check:'dfm-preflight' — material thickness in inches."
},
"thickness_mm": {
"type": "number",
"description": "check:'dfm-preflight' — material thickness in millimeters."
},
"tolerance_mm": {
"type": "number",
"minimum": 0,
"description": "check:'fastener-installation' — linear tolerance, default .05 mm."
},
"max_radius_mm": {
"type": "number",
"minimum": 0,
"description": "check:'edge-radius' — maximum fillet radius in mm; must be >= min_radius_mm."
},
"min_radius_mm": {
"type": "number",
"minimum": 0,
"description": "check:'edge-radius' — minimum fillet radius in mm (does not imply sharp-edge prohibition)."
},
"prefer_solver": {
"enum": [
"analytical",
"numeric",
"auto"
],
"type": "string",
"description": "check:'reachable' — force the IK path ('auto' default)."
},
"range_samples": {
"type": "number",
"description": "check:'static-hold' — grid density per evaluated joint when `pose` is omitted (default 9). check:'motion-load' motion_mode:'range' — grid points per joint (default 5)."
},
"series_points": {
"type": "number",
"description": "check:'motion-load' — max torque-vs-time points per joint in the result (default 120; 0 omits the series)."
},
"asserted_plane": {
"type": "object",
"required": [
"origin",
"normal"
],
"properties": {
"normal": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
},
"origin": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
}
},
"description": "check:'geometry-quality' — optional required mirror plane in model coordinates; normal is normalized and must be nonzero.",
"additionalProperties": false
},
"max_iterations": {
"type": "number",
"description": "check:'reachable' — numeric-path iteration cap."
},
"refresh_catalog": {
"type": "boolean",
"description": "check:'dfm-preflight' — force vendor catalog refresh."
},
"target_position": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "check:'reachable' — target [x, y, z] mm (world frame)."
},
"min_clearance_mm": {
"type": "number",
"minimum": 0,
"description": "check:'clearance-range' — planned clearance (mm) for movable mate pairs without a declared clearances entry; overrides dfmSpec minClearance."
},
"samples_per_mate": {
"type": "integer",
"maximum": 64,
"minimum": 1,
"description": "check:'clearance-range' — pose samples per limited mate: min, interior..., max (default 5)."
},
"disassembly_order": {
"type": "boolean",
"description": "check:'assembly-path' — iteratively remove freed parts and return removalOrder or stuckParts."
},
"mesh_deflection_mm": {
"type": "number",
"minimum": 1e-7,
"description": "check:'geometry-quality' — absolute mesh deflection, defaults to tolerance/4; must be <= tolerance/2."
},
"require_edge_break": {
"enum": [
"external",
"internal",
"all"
],
"type": "string",
"description": "check:'edge-radius' — prohibit sharp convex/external, concave/internal, or all edges."
},
"target_orientation": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "check:'reachable' — target XYZ Euler angles in radians."
},
"threaded_fasteners": {
"type": "array",
"items": {
"type": "string"
},
"description": "check:'assembly-path' — part names that need a helical removal. Catalog screw/bolt/nut families are detected automatically; without a fastened-mate fastener declaration (axis/pitch) they remain unknown: non-straight-path. Declare the motion on arm.mate(..., 'fastened', { fastener: { part, axis, pitchMm, tool? }, fit?: { kind, part? } })."
},
"tiny_face_area_mm2": {
"type": "number",
"default": 0.01,
"minimum": 0,
"description": "check:'geometry-quality' — flag faces strictly below this absolute area; zero disables."
},
"tiny_face_relative": {
"type": "number",
"default": 0,
"maximum": 1,
"minimum": 0,
"description": "check:'geometry-quality' — fraction of total BREP surface area, ORed with absolute threshold."
},
"angle_tolerance_deg": {
"type": "number",
"maximum": 90,
"minimum": 0,
"description": "check:'fastener-installation' — axis tilt tolerance, default 1 degree."
},
"contact_tolerance_mm": {
"type": "number",
"minimum": 0,
"description": "check:'assembly-path' with stability:true — surface distance at or below which parts count as touching (default 0.05 mm)."
},
"short_edge_length_mm": {
"type": "number",
"default": 0.1,
"minimum": 0,
"description": "check:'geometry-quality' — flag edges strictly below this length; zero disables."
},
"min_torque_margin_pct": {
"type": "number",
"description": "check:'static-hold' — safety-margin floor as a percent of actuator capacity (default 20)."
},
"position_tolerance_mm": {
"type": "number",
"description": "check:'reachable' — position tolerance in mm."
},
"symmetry_tolerance_mm": {
"type": "number",
"default": 0.05,
"minimum": 0.000001,
"description": "check:'geometry-quality' — maximum sampled mirror-to-mesh distance, mm."
},
"collision_tolerance_mm3": {
"type": "number",
"description": "check:'swept-collision' — BREP intersection volume tolerance (mm^3)."
},
"safety_factor_threshold": {
"type": "number",
"description": "check:'load-capacity' — pass/fail safety-factor floor (default 1.5; mode 'fea': the study's minSafetyFactor when declared)."
},
"orientation_tolerance_rad": {
"type": "number",
"description": "check:'reachable' — orientation tolerance in radians."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Verify Design",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to trace why a feature failed. Walk the upstream chain of a failing feature. Returns the diagnostics of the requested feature plus the diagnostics of every upstream feature in topological order (the requested feature is the last entry). Per-code hints are inline on every diagnostic — call lookup_diagnostics for the full catalogue. Pass { file?, code?, feature_id? }.
| Parameter | Type | Description |
|---|---|---|
| code | string | |
| file | string | Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| feature_id | string |
{
"name": "why_did_this_fail",
"title": "Explain Failure",
"description": "Use this when you need to trace why a feature failed. Walk the upstream chain of a failing feature. Returns the diagnostics of the requested feature plus the diagnostics of every upstream feature in topological order (the requested feature is the last entry). Per-code hints are inline on every diagnostic — call lookup_diagnostics for the full catalogue. Pass { file?, code?, feature_id? }.",
"inputSchema": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"file": {
"type": "string",
"description": "Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"feature_id": {
"type": "string"
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Explain Failure",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to edit a param() default value in a kernelCAD script. Returns the modified code as text plus diagnostics from re-evaluating the result. Caller persists the new code via standard file-write tools (this tool has no side effects). With preview: true it builds the edit in a scratch session instead and returns the diff_geometry summary plus the requirements-ledger and S1 binding diffs (which requirements flip, which margins shrink, which selectors moved or re-bound), without touching the active session, source, revision or caches. A preview whose revised build fails returns ok:false and no diff. Inspect after.requirementsOk to see whether the edit preserves declared intent; preview.ok only says the preview could be computed. FEATURE MODE: pass { feature, changes } instead of param_name/new_value to change a feature's own literal arguments in place, by feature id (inspect({ of: 'features' }) lists ids and parameter names), e.g. { feature: 'cylinder_1', changes: { r: 3.3 } }. The argument is found from the feature's call site and each rewrite is verified by re-capturing the script; the whole model is rebuilt before and after, and the result carries new_code, edits (argument source before/after, line), changedParams (every feature parameter that moved) and the same geometry / requirementsDiff / bindings diff as preview. Writes nothing. A value driven by param() is refused with a hint to use set_param on that param instead.
| Parameter | Type | Description |
|---|---|---|
| code * | string | The .kcad.ts source code. |
| changes | object | Feature mode: the feature's parameters to set, by parameter name, in mm or deg (e.g. { r: 3.3 }). |
| feature | string | Feature mode: id of the feature to edit in place (e.g. 'cylinder_1'). Use with `changes` instead of param_name/new_value. |
| preview | boolean | S6 edit preview: evaluate the edit in a scratch session and return geometry + requirements-ledger + S1 binding diffs. Writes nothing. Default false (the normal source-edit result). |
| new_value | any | The new default value. A number for a numeric param (e.g. 12.5), a string expression evaluated in the script (e.g. "width/2 + 3") or a choice/colour, or true/false for a boolean param. |
| param_name | string | The string literal name of the param (first arg to param()). |
{
"name": "set_param",
"title": "Set Parameter",
"description": "Use this when you need to edit a param() default value in a kernelCAD script. Returns the modified code as text plus diagnostics from re-evaluating the result. Caller persists the new code via standard file-write tools (this tool has no side effects). With preview: true it builds the edit in a scratch session instead and returns the diff_geometry summary plus the requirements-ledger and S1 binding diffs (which requirements flip, which margins shrink, which selectors moved or re-bound), without touching the active session, source, revision or caches. A preview whose revised build fails returns ok:false and no diff. Inspect after.requirementsOk to see whether the edit preserves declared intent; preview.ok only says the preview could be computed. FEATURE MODE: pass { feature, changes } instead of param_name/new_value to change a feature's own literal arguments in place, by feature id (inspect({ of: 'features' }) lists ids and parameter names), e.g. { feature: 'cylinder_1', changes: { r: 3.3 } }. The argument is found from the feature's call site and each rewrite is verified by re-capturing the script; the whole model is rebuilt before and after, and the result carries new_code, edits (argument source before/after, line), changedParams (every feature parameter that moved) and the same geometry / requirementsDiff / bindings diff as preview. Writes nothing. A value driven by param() is refused with a hint to use set_param on that param instead.",
"inputSchema": {
"type": "object",
"required": [
"code"
],
"properties": {
"code": {
"type": "string",
"description": "The .kcad.ts source code."
},
"changes": {
"type": "object",
"description": "Feature mode: the feature's parameters to set, by parameter name, in mm or deg (e.g. { r: 3.3 }).",
"additionalProperties": {
"type": "number"
}
},
"feature": {
"type": "string",
"description": "Feature mode: id of the feature to edit in place (e.g. 'cylinder_1'). Use with `changes` instead of param_name/new_value."
},
"preview": {
"type": "boolean",
"description": "S6 edit preview: evaluate the edit in a scratch session and return geometry + requirements-ledger + S1 binding diffs. Writes nothing. Default false (the normal source-edit result)."
},
"new_value": {
"oneOf": [
{
"type": "number"
},
{
"type": "string"
},
{
"type": "boolean"
}
],
"examples": [
12.5,
"width/2 + 3",
true
],
"description": "The new default value. A number for a numeric param (e.g. 12.5), a string expression evaluated in the script (e.g. \"width/2 + 3\") or a choice/colour, or true/false for a boolean param."
},
"param_name": {
"type": "string",
"description": "The string literal name of the param (first arg to param())."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Set Parameter",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to insert a new feature line into a script. Insert a new feature line into a kernelCAD script before the last top-level return statement. Returns the modified code as text plus diagnostics from re-evaluating the result. Direct editing is authored here too: use `body.deleteFace(faces)` to heal a removed-face opening, or `body.replaceFace(faces, { origin, normal })` for a parallel planar replacement; the runtime refuses any result that does not pass its single-solid BRepCheck gate. Primitives that accept faceLabels (box, cylinder, extrudeRect, extrudeCircle, extrudePolygon, extrudeRoundedRect) can receive `opts.faceLabels` in the inserted code — use `lookup_api` to see `featureKindFaceLabels` for the full value schema.
| Parameter | Type | Description |
|---|---|---|
| code * | string | The .kcad.ts source code. |
| feature_code * | string | Single-statement source line to insert. A narrow analytic G4 certificate is available only for a terminal, unlabeled 360-degree revolve followed only by finite translations, finite rotations about an axis of finite positive squared length, uniform scales by one finite positive factor, and reflection… |
{
"name": "add_feature",
"title": "Add Feature",
"description": "Use this when you need to insert a new feature line into a script. Insert a new feature line into a kernelCAD script before the last top-level return statement. Returns the modified code as text plus diagnostics from re-evaluating the result. Direct editing is authored here too: use `body.deleteFace(faces)` to heal a removed-face opening, or `body.replaceFace(faces, { origin, normal })` for a parallel planar replacement; the runtime refuses any result that does not pass its single-solid BRepCheck gate. Primitives that accept faceLabels (box, cylinder, extrudeRect, extrudeCircle, extrudePolygon, extrudeRoundedRect) can receive `opts.faceLabels` in the inserted code — use `lookup_api` to see `featureKindFaceLabels` for the full value schema.",
"inputSchema": {
"type": "object",
"required": [
"code",
"feature_code"
],
"properties": {
"code": {
"type": "string",
"description": "The .kcad.ts source code."
},
"feature_code": {
"type": "string",
"description": "Single-statement source line to insert. A narrow analytic G4 certificate is available only for a terminal, unlabeled 360-degree revolve followed only by finite translations, finite rotations about an axis of finite positive squared length, uniform scales by one finite positive factor, and reflections across a cardinal plane with a finite optional offset, with no downstream consumers, using a move + 2–128 three-point arcs + close profile. Exact dyadic checks require the move point and a later endpoint to be antipodal, every endpoint and midpoint on the same exactly representable circle, and exact cyclic ordering that proves the arcs partition it once without gaps or overlaps; the circle must satisfy R > r > 0. The lowerer constructs one OCCT analytic torus face, independently enumerates both closed periodic self-seams, measures both stored p-curve branches at finite D0–D4 stations within edge-tolerance limits, and requires a valid nonempty one-solid result with finite positive volume. An outward-rounded torus period bound covers the full seam domains; station readings are conformance checks, not the proof. A rotated, uniformly scaled or reflected result is certified only when its final torus support frame, read from the built face and normalized by the product k of the scale factors, is within 2^-30 of an orthonormal frame and of the source tube ratio; the bounds carry that distortion. Every certificate is conditional on unproved assumptions: an OCCT TORUS support evaluates the closed-form torus formula, and, for a rotated, scaled or reflected result, OCCT evaluates the torus derivatives at u = v = 0 with relative error at most 2^-40. Non-uniform scale, malformed reflection planes, face labels, downstream consumers, near-circular, axis-touching/crossing, partial-turn, malformed, incomplete, and otherwise unsupported cases remain sampled or uncertified; nine stations alone do not prove continuity."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Add Feature",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need an organic, freeform, or swept shape — a body shell, panel, fairing, ergonomic curve, lens, or sculpted form — authored as a NURBS Surface into the user's .kcad.ts, OR when you need to finish surfaces into a watertight solid or taper faces for moldability. One authoring/finishing path, selected by `kind`: - 'nurbs' — insert a nurbsSurface(...) / surfaceFromCurves(...) call. Pass either { controls, degree, weights?, knots?, periodic? } for direct construction, OR { section_sketch_ids } for skinning. Weights are honored: supply rational weights to build exact circles/cylinders/spheres/conics (the surface becomes rational); omit weights for a non-rational surface. - 'patchFamily' — insert a nurbsPatchFamily(...) solid built from degree-5+ shared-knot NURBS caps. Pass { controls, degree, split_direction, extrusion, split_knot? }. The selected split knot must have multiplicity m <= split-direction degree - 4 (C4 or better). For finite rectangular, non-rational, non-periodic inputs with C1-or-better split-direction knots and C4-or-better tangential knots, outward-rounded active derivative-control intervals must keep one Jacobian component strictly away from zero on every pair of nonzero U/V knot spans of both actual caps; rotated control nets can qualify. The lowerer independently enumerates both internal cap split seams and requires finite D0–D4 conformance samples plus a valid nonempty one-solid B-rep. Samples are a fail-closed cross-check, not the continuous proof. Any inconclusive cell or other unsupported input remains sampled-only or uncertified. Cap-to-side closure seams and whole-solid G4 are outside this certificate scope. - 'planeBlend' — insert planeBlendSurface(railA, railB, { normalA, normalB, handleLengthMm? }) for two corresponding, equally oriented, straight parallel rails on planar supports. This is a separate G2 blend construction, not an OCCT fillet. Pass rail_a_binding / rail_b_binding (declared Curve3D variables) and unit support normals. Sew the returned patch with both support surfaces; the measured achieved class belongs to those joined seams. - 'boundary' — insert a surfaceFromBoundary([c1,c2,c3,c4], opts?) call: one NURBS face through 4 boundary Curve3D refs (bottom, right, top, left in loop order; adjacent endpoints must coincide within 1e-6 mm). - 'trim' — insert a `<surface>.trimTo(<by>)` or `<surface>.split(<by>)` call. Pass `surface_binding` (the Surface variable name), `by_binding` (the cutter Surface variable name; Shape/Curve3D cutters are deferred to a later slice), and `op: 'trim'` (keep the largest imprinted piece) or `op: 'split'` (return both halves as a `[Surface, Surface]` tuple). - 'sew' — insert a `sew([s0, s1, ...], opts?)` call to stitch N surfaces. Pass `surface_bindings` (array of Surface variable names). Optional `continuity: 'G0'|'G1'|'G2'|'G3'|'G4'` asks the lowerer to report sampled shared-seam results. G3/G4 always produce a warning, even when all finite samples meet their thresholds; the results are explicitly sampled-only and uncertified, with no exact or seam-wide proof. The `nurbsPatchFamily` analytic certificate is limited to its two internal cap split seams and the documented input class; other inputs remain uncertified. Lower-grade requests warn when their measured class is below the request. `tolerance` defaults to 1e-6 mm; `require_closed` errors if the result is not watertight. - 'draft' — insert a `<shape>.draft(angleDeg, { face, neutralPlane?, pullDir? })` call to taper the selected face(s) for mold release. Pass `shape_binding`, `angle_deg` (0–90), and `face` (canonical name, label, or FaceQuery descriptor). Lowering emits feature.draft.failed on invalid geometry. The returned Surface produces no Shape until you chain .thicken(t) or .toShape() (do that via add_feature on the binding name). Returns the modified code + diagnostics. Each kind fails closed on its own missing required params.
| Parameter | Type | Description |
|---|---|---|
| op | string | kind:'trim' — 'trim' discards the smaller half (calls .trimTo()); 'split' retains both halves (calls .split()). |
| code * | string | Current .kcad.ts source. |
| face | string | kind:'draft' — face selector for the face(s) to taper. Accepts a canonical name (top/bottom/front/back/left/right), a user label declared via faceLabels, or a FaceQuery descriptor string. |
| kind * | string | Which surface-construction or surface-finishing path to use: 'nurbs' | 'patchFamily' | 'planeBlend' | 'boundary' | 'trim' | 'sew' | 'draft'. |
| knots | object | kind:'nurbs' or 'patchFamily' — optional explicit knot vectors; missing => clamped uniform inferred. patchFamily split_knot must select an interior knot with multiplicity <= split-direction degree - 4. |
| degree | object | kind:'nurbs' or 'patchFamily' — degrees in U and V; patchFamily requires split-direction degree >= 5 and enough controls for an interior knot with multiplicity <= degree - 4. |
| weights | array | kind:'nurbs' or 'patchFamily' — optional positive rational weights, same grid shape as controls. Rational weights are outside the restricted patchFamily analytic certificate class. |
| controls | array | kind:'nurbs' or 'patchFamily' — control-point grid (controls[u][v] = [x, y, z], mm). patchFamily uses degree-5+ caps and an interior split knot with multiplicity <= split-direction degree - 4. |
| normal_a | array | kind:'planeBlend' — unit normal of the first planar support face. |
{
"name": "add_surface",
"title": "Add Surface",
"description": "Use this when you need an organic, freeform, or swept shape — a body shell, panel, fairing, ergonomic curve, lens, or sculpted form — authored as a NURBS Surface into the user's .kcad.ts, OR when you need to finish surfaces into a watertight solid or taper faces for moldability. One authoring/finishing path, selected by `kind`:\n- 'nurbs' — insert a nurbsSurface(...) / surfaceFromCurves(...) call. Pass either { controls, degree, weights?, knots?, periodic? } for direct construction, OR { section_sketch_ids } for skinning. Weights are honored: supply rational weights to build exact circles/cylinders/spheres/conics (the surface becomes rational); omit weights for a non-rational surface.\n- 'patchFamily' — insert a nurbsPatchFamily(...) solid built from degree-5+ shared-knot NURBS caps. Pass { controls, degree, split_direction, extrusion, split_knot? }. The selected split knot must have multiplicity m <= split-direction degree - 4 (C4 or better). For finite rectangular, non-rational, non-periodic inputs with C1-or-better split-direction knots and C4-or-better tangential knots, outward-rounded active derivative-control intervals must keep one Jacobian component strictly away from zero on every pair of nonzero U/V knot spans of both actual caps; rotated control nets can qualify. The lowerer independently enumerates both internal cap split seams and requires finite D0–D4 conformance samples plus a valid nonempty one-solid B-rep. Samples are a fail-closed cross-check, not the continuous proof. Any inconclusive cell or other unsupported input remains sampled-only or uncertified. Cap-to-side closure seams and whole-solid G4 are outside this certificate scope.\n- 'planeBlend' — insert planeBlendSurface(railA, railB, { normalA, normalB, handleLengthMm? }) for two corresponding, equally oriented, straight parallel rails on planar supports. This is a separate G2 blend construction, not an OCCT fillet. Pass rail_a_binding / rail_b_binding (declared Curve3D variables) and unit support normals. Sew the returned patch with both support surfaces; the measured achieved class belongs to those joined seams.\n- 'boundary' — insert a surfaceFromBoundary([c1,c2,c3,c4], opts?) call: one NURBS face through 4 boundary Curve3D refs (bottom, right, top, left in loop order; adjacent endpoints must coincide within 1e-6 mm).\n- 'trim' — insert a `<surface>.trimTo(<by>)` or `<surface>.split(<by>)` call. Pass `surface_binding` (the Surface variable name), `by_binding` (the cutter Surface variable name; Shape/Curve3D cutters are deferred to a later slice), and `op: 'trim'` (keep the largest imprinted piece) or `op: 'split'` (return both halves as a `[Surface, Surface]` tuple).\n- 'sew' — insert a `sew([s0, s1, ...], opts?)` call to stitch N surfaces. Pass `surface_bindings` (array of Surface variable names). Optional `continuity: 'G0'|'G1'|'G2'|'G3'|'G4'` asks the lowerer to report sampled shared-seam results. G3/G4 always produce a warning, even when all finite samples meet their thresholds; the results are explicitly sampled-only and uncertified, with no exact or seam-wide proof. The `nurbsPatchFamily` analytic certificate is limited to its two internal cap split seams and the documented input class; other inputs remain uncertified. Lower-grade requests warn when their measured class is below the request. `tolerance` defaults to 1e-6 mm; `require_closed` errors if the result is not watertight.\n- 'draft' — insert a `<shape>.draft(angleDeg, { face, neutralPlane?, pullDir? })` call to taper the selected face(s) for mold release. Pass `shape_binding`, `angle_deg` (0–90), and `face` (canonical name, label, or FaceQuery descriptor). Lowering emits feature.draft.failed on invalid geometry.\nThe returned Surface produces no Shape until you chain .thicken(t) or .toShape() (do that via add_feature on the binding name). Returns the modified code + diagnostics. Each kind fails closed on its own missing required params.",
"inputSchema": {
"type": "object",
"required": [
"kind",
"code"
],
"properties": {
"op": {
"enum": [
"trim",
"split"
],
"type": "string",
"description": "kind:'trim' — 'trim' discards the smaller half (calls .trimTo()); 'split' retains both halves (calls .split())."
},
"code": {
"type": "string",
"description": "Current .kcad.ts source."
},
"face": {
"type": "string",
"description": "kind:'draft' — face selector for the face(s) to taper. Accepts a canonical name (top/bottom/front/back/left/right), a user label declared via faceLabels, or a FaceQuery descriptor string."
},
"kind": {
"enum": [
"nurbs",
"patchFamily",
"planeBlend",
"boundary",
"trim",
"sew",
"draft"
],
"type": "string",
"description": "Which surface-construction or surface-finishing path to use: 'nurbs' | 'patchFamily' | 'planeBlend' | 'boundary' | 'trim' | 'sew' | 'draft'."
},
"knots": {
"type": "object",
"properties": {
"u": {
"type": "array",
"items": {
"type": "number"
}
},
"v": {
"type": "array",
"items": {
"type": "number"
}
}
},
"description": "kind:'nurbs' or 'patchFamily' — optional explicit knot vectors; missing => clamped uniform inferred. patchFamily split_knot must select an interior knot with multiplicity <= split-direction degree - 4."
},
"degree": {
"type": "object",
"required": [
"u",
"v"
],
"properties": {
"u": {
"type": "integer",
"minimum": 1
},
"v": {
"type": "integer",
"minimum": 1
}
},
"description": "kind:'nurbs' or 'patchFamily' — degrees in U and V; patchFamily requires split-direction degree >= 5 and enough controls for an interior knot with multiplicity <= degree - 4."
},
"weights": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
}
},
"description": "kind:'nurbs' or 'patchFamily' — optional positive rational weights, same grid shape as controls. Rational weights are outside the restricted patchFamily analytic certificate class."
},
"controls": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
}
}
},
"description": "kind:'nurbs' or 'patchFamily' — control-point grid (controls[u][v] = [x, y, z], mm). patchFamily uses degree-5+ caps and an interior split knot with multiplicity <= split-direction degree - 4."
},
"normal_a": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "kind:'planeBlend' — unit normal of the first planar support face."
},
"normal_b": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "kind:'planeBlend' — unit normal of the second planar support face."
},
"periodic": {
"type": "object",
"properties": {
"u": {
"type": "boolean"
},
"v": {
"type": "boolean"
}
},
"description": "kind:'nurbs' — optional periodic flags per parametric direction."
},
"pull_dir": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "kind:'draft' — demoulding direction as [x, y, z]. Defaults to the face normal at lower time."
},
"sampling": {
"type": "integer",
"minimum": 1,
"description": "kind:'boundary' — points sampled along each boundary (default 15)."
},
"angle_deg": {
"type": "number",
"maximum": 90,
"minimum": 0,
"description": "kind:'draft' — draft angle in degrees [0, 90]. The face is tapered outward by this angle relative to the pull direction."
},
"extrusion": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "kind:'patchFamily' — finite non-zero translation [x, y, z] in mm from the first NURBS cap to the opposite cap."
},
"tolerance": {
"type": "number",
"description": "kind:'sew' — edge-merging tolerance in mm (default 1e-6). Edges within this distance are merged."
},
"by_binding": {
"type": "string",
"description": "kind:'trim' — JS variable name of the cutter Surface (must be declared in source). Shape/Curve3D cutters are deferred."
},
"continuity": {
"oneOf": [
{
"enum": [
"C0",
"C1",
"C2",
"G0",
"G1",
"G2",
"G3",
"G4"
],
"type": "string"
},
{
"type": "array",
"items": {
"enum": [
"C0",
"C1",
"C2"
],
"type": "string"
},
"maxItems": 4,
"minItems": 4
}
],
"description": "kind:'boundary' — C0 only; C1/C2 fail because no neighboring support surfaces are supplied. kind:'sew' — minimum sampled continuity for every topology-enumerated shared seam ('G0' | 'G1' | 'G2' | 'G3' | 'G4'); G3/G4 use common-UV NURBS samples and are explicitly uncertified, not exact or seam-wide proofs."
},
"split_knot": {
"type": "number",
"description": "kind:'patchFamily' — optional knot value to split at; defaults to the first interior knot whose multiplicity gives C4 or better."
},
"binding_name": {
"type": "string",
"description": "JS const name for the new binding (kind:'nurbs' default surface_<N>; kind:'patchFamily' default patch_family_<N>; kind:'planeBlend' default plane_blend_<N>; kind:'boundary' default _surface_<N>; kind:'trim' default _trimmed_<N>; kind:'sew' default _sewn_<N>; kind:'draft' default _drafted_<N>)."
},
"neutral_plane": {
"type": "string",
"description": "kind:'draft' — parting-line face (the plane where drafted faces remain fixed). Defaults to `face` if omitted."
},
"shape_binding": {
"type": "string",
"description": "kind:'draft' — JS variable name of the Shape to taper (must be declared in source)."
},
"curve_bindings": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 4,
"minItems": 4,
"description": "kind:'boundary' — tuple of 4 existing Curve3D variable names (bottom, right, top, left) declared earlier in the source."
},
"face_tolerance": {
"type": "number",
"description": "kind:'patchFamily' — positive OCCT face-construction tolerance in mm (default 1e-6).",
"exclusiveMinimum": 0
},
"rail_a_binding": {
"type": "string",
"description": "kind:'planeBlend' — existing Curve3D variable name for the first straight support rail."
},
"rail_b_binding": {
"type": "string",
"description": "kind:'planeBlend' — existing Curve3D variable name for the second corresponding, parallel support rail."
},
"require_closed": {
"type": "boolean",
"description": "kind:'sew' — when true the lowerer emits feature.surface-sew.open-shell if the stitched result is not a watertight solid."
},
"split_direction": {
"enum": [
"u",
"v"
],
"type": "string",
"description": "kind:'patchFamily' — parameter direction for the shared interior knot with multiplicity <= degree - 4 and measured target seam."
},
"surface_binding": {
"type": "string",
"description": "kind:'trim' — JS variable name of the Surface to trim/split (must be declared in source)."
},
"handle_length_mm": {
"type": "number",
"description": "kind:'planeBlend' — positive quintic control-handle length in mm; default is one tenth of the rail gap.",
"exclusiveMinimum": 0
},
"surface_bindings": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1,
"description": "kind:'sew' — JS variable names of the surfaces to stitch into a solid (each must be declared in source)."
},
"section_sketch_ids": {
"type": "array",
"items": {
"type": "string"
},
"description": "kind:'nurbs' — existing sketch FeatureIds (2 or more) to skin a surface through, in order."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Add Surface",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need a freeform/organic 3D curve — a body feature line, brow, spine rail, or curve bridge between panel boundaries — authored as a Curve3D into the user's .kcad.ts immediately before the last top-level return. One authoring path, selected by `kind`: - 'nurbs' — insert a `nurbsCurve(controlPoints, opts?)` declaration. Pass `control_points` as a Vec3[] (mm, at least 2 points). Optional NURBS knobs: `degree` (default 3), rational `weights`, explicit `knots`, `closed`. - 'hermite' — insert a `hermiteG2(a, b)` declaration: a quintic Hermite curve interpolating two endpoints with matching positions, tangents, and (optional) curvatures — bridges two curves with G2 continuity. Each endpoint is `{ point: Vec3, tangent: Vec3, curvature?: Vec3 }` in mm; tangent magnitude ~ chord length; curvature defaults to [0,0,0] (G1-only). The returned binding has type Curve3D (peer to Shape / Surface) — consume it via `add_variable_sweep` (spine input), `add_surface({ kind: 'boundary' })` (boundary curve), or downstream Curve3D-accepting features. Returns the modified code + diagnostics from re-evaluating. Side-effect-free. Each kind fails closed on its own missing required params.
| Parameter | Type | Description |
|---|---|---|
| a | object | kind:'hermite' — start endpoint. |
| b | object | kind:'hermite' — end endpoint. |
| code * | string | The .kcad.ts source code. |
| kind * | string | Which curve-construction path to use. |
| knots | array | kind:'nurbs' — optional explicit knot vector; missing => clamped-uniform inferred. |
| closed | boolean | kind:'nurbs' — optional periodic/closed-curve flag. |
| degree | integer | kind:'nurbs' — curve degree; default 3 (cubic). |
| weights | array | kind:'nurbs' — optional rational weights, one per control point (same length as control_points). |
| binding_name | string | JS const name for the new Curve3D binding (default: _curve_<N>). |
| control_points | array | kind:'nurbs' — control points as Vec3 triples in mm; at least 2 entries. |
{
"name": "add_curve",
"title": "Add Curve",
"description": "Use this when you need a freeform/organic 3D curve — a body feature line, brow, spine rail, or curve bridge between panel boundaries — authored as a Curve3D into the user's .kcad.ts immediately before the last top-level return. One authoring path, selected by `kind`:\n- 'nurbs' — insert a `nurbsCurve(controlPoints, opts?)` declaration. Pass `control_points` as a Vec3[] (mm, at least 2 points). Optional NURBS knobs: `degree` (default 3), rational `weights`, explicit `knots`, `closed`.\n- 'hermite' — insert a `hermiteG2(a, b)` declaration: a quintic Hermite curve interpolating two endpoints with matching positions, tangents, and (optional) curvatures — bridges two curves with G2 continuity. Each endpoint is `{ point: Vec3, tangent: Vec3, curvature?: Vec3 }` in mm; tangent magnitude ~ chord length; curvature defaults to [0,0,0] (G1-only).\nThe returned binding has type Curve3D (peer to Shape / Surface) — consume it via `add_variable_sweep` (spine input), `add_surface({ kind: 'boundary' })` (boundary curve), or downstream Curve3D-accepting features. Returns the modified code + diagnostics from re-evaluating. Side-effect-free. Each kind fails closed on its own missing required params.",
"inputSchema": {
"type": "object",
"allOf": [
{
"if": {
"properties": {
"kind": {
"const": "nurbs"
}
}
},
"then": {
"required": [
"control_points"
]
}
},
{
"if": {
"properties": {
"kind": {
"const": "hermite"
}
}
},
"then": {
"required": [
"a",
"b"
]
}
}
],
"required": [
"kind",
"code"
],
"properties": {
"a": {
"type": "object",
"required": [
"point",
"tangent"
],
"properties": {
"point": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "Endpoint position in mm."
},
"tangent": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "First derivative of the curve at this endpoint."
},
"curvature": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "Optional second derivative; defaults to [0, 0, 0] (G1-only)."
}
},
"description": "kind:'hermite' — start endpoint."
},
"b": {
"type": "object",
"required": [
"point",
"tangent"
],
"properties": {
"point": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "Endpoint position in mm."
},
"tangent": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "First derivative of the curve at this endpoint."
},
"curvature": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "Optional second derivative; defaults to [0, 0, 0] (G1-only)."
}
},
"description": "kind:'hermite' — end endpoint."
},
"code": {
"type": "string",
"description": "The .kcad.ts source code."
},
"kind": {
"enum": [
"nurbs",
"hermite"
],
"type": "string",
"description": "Which curve-construction path to use."
},
"knots": {
"type": "array",
"items": {
"type": "number"
},
"description": "kind:'nurbs' — optional explicit knot vector; missing => clamped-uniform inferred."
},
"closed": {
"type": "boolean",
"description": "kind:'nurbs' — optional periodic/closed-curve flag."
},
"degree": {
"type": "integer",
"minimum": 1,
"description": "kind:'nurbs' — curve degree; default 3 (cubic)."
},
"weights": {
"type": "array",
"items": {
"type": "number"
},
"description": "kind:'nurbs' — optional rational weights, one per control point (same length as control_points)."
},
"binding_name": {
"type": "string",
"description": "JS const name for the new Curve3D binding (default: _curve_<N>)."
},
"control_points": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
},
"description": "kind:'nurbs' — control points as Vec3 triples in mm; at least 2 entries."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Add Curve",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need a freeform/organic 2D outline — an eyewear brow, ergonomic grip, sneaker midsole, or body silhouette — by appending a curved segment to an existing PathBuilder chain on the named `chain_anchor` variable. The call is injected at the END of the chain, immediately before any `.close()`. One segment kind, selected by `kind`: - 'spline' — `.spline(points, opts?)`: interpolates through every `points` waypoint (Vec2[] mm, >= 2 entries; points[0] must match current pen position). Optional `tension`, and `start_tangent`/`end_tangent` (inserted as script opts `startTangent`/`endTangent`). Use for organic 2D outlines (eyewear brow, ergonomic handle, sneaker midsole). - 'nurbs' — `.nurbsSegment(controlPoints, opts?)`: explicit B-spline net (Vec2[] mm, >= degree+1 entries). Pass `control_points`; control_points[0] must match pen and the pen ends at control_points[N-1]. Optional `degree` (default 3), rational `weights` (strictly positive), explicit `knots` (length = control_points.length + degree + 1). - 'hermite' — `.hermiteG2(a, b)`: each endpoint `{ point: Vec2, tangent: Vec2, curvature?: Vec2 }` in mm (a.point must match pen; pen ends at b.point). `curvature` defaults to [0,0] (G1); pass matching curvatures for G2 blends. Tangent magnitude is the first derivative (~ chord length), NOT unit length. Returns the modified code + diagnostics from re-evaluating. Side-effect-free. Each kind fails closed on its own missing required params.
| Parameter | Type | Description |
|---|---|---|
| a | object | kind:'hermite' — start endpoint; point must match current pen position within 1e-6 mm. |
| b | object | kind:'hermite' — end endpoint; pen ends at b.point. |
| code * | string | The .kcad.ts source code. |
| kind * | string | Which path-segment kind to append. |
| knots | array | kind:'nurbs' — optional explicit knot vector; length must equal control_points.length + degree + 1. |
| degree | integer | kind:'nurbs' — B-spline degree (default 3). |
| points | array | kind:'spline' — waypoints as Vec2 pairs in mm; at least 2 entries; first must match current pen position. |
| tension | number | kind:'spline' — optional Catmull-Rom-style stiffness; forwarded to the underlying B-spline approximation. |
| weights | array | kind:'nurbs' — optional rational weights (one per control point; strictly positive). |
| end_tangent | array | kind:'spline' — optional [x, y] direction vector at points[N-1]. Magnitude is normalised internally; direction matters. |
| binding_name | string | Reserved for future use; the segment injection mutates the chain anchor in place. |
| chain_anchor * | string | JS identifier of an existing PathBuilder binding (e.g. `const brow = path().moveTo(0,0)`). |
| start_tangent | array | kind:'spline' — optional [x, y] direction vector at points[0]. Magnitude is normalised internally; direction matters. |
| control_points | array | kind:'nurbs' — control-net vertices as Vec2 pairs in mm; at least degree+1 entries. |
{
"name": "add_path_segment",
"title": "Add Path Segment",
"description": "Use this when you need a freeform/organic 2D outline — an eyewear brow, ergonomic grip, sneaker midsole, or body silhouette — by appending a curved segment to an existing PathBuilder chain on the named `chain_anchor` variable. The call is injected at the END of the chain, immediately before any `.close()`. One segment kind, selected by `kind`:\n- 'spline' — `.spline(points, opts?)`: interpolates through every `points` waypoint (Vec2[] mm, >= 2 entries; points[0] must match current pen position). Optional `tension`, and `start_tangent`/`end_tangent` (inserted as script opts `startTangent`/`endTangent`). Use for organic 2D outlines (eyewear brow, ergonomic handle, sneaker midsole).\n- 'nurbs' — `.nurbsSegment(controlPoints, opts?)`: explicit B-spline net (Vec2[] mm, >= degree+1 entries). Pass `control_points`; control_points[0] must match pen and the pen ends at control_points[N-1]. Optional `degree` (default 3), rational `weights` (strictly positive), explicit `knots` (length = control_points.length + degree + 1).\n- 'hermite' — `.hermiteG2(a, b)`: each endpoint `{ point: Vec2, tangent: Vec2, curvature?: Vec2 }` in mm (a.point must match pen; pen ends at b.point). `curvature` defaults to [0,0] (G1); pass matching curvatures for G2 blends. Tangent magnitude is the first derivative (~ chord length), NOT unit length.\nReturns the modified code + diagnostics from re-evaluating. Side-effect-free. Each kind fails closed on its own missing required params.",
"inputSchema": {
"type": "object",
"allOf": [
{
"if": {
"properties": {
"kind": {
"const": "spline"
}
}
},
"then": {
"required": [
"points"
]
}
},
{
"if": {
"properties": {
"kind": {
"const": "nurbs"
}
}
},
"then": {
"required": [
"control_points"
]
}
},
{
"if": {
"properties": {
"kind": {
"const": "hermite"
}
}
},
"then": {
"required": [
"a",
"b"
]
}
}
],
"required": [
"kind",
"code",
"chain_anchor"
],
"properties": {
"a": {
"type": "object",
"required": [
"point",
"tangent"
],
"properties": {
"point": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"description": "Endpoint position in mm."
},
"tangent": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"description": "First derivative (~ chord length), NOT unit length."
},
"curvature": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"description": "Optional second derivative; defaults to [0, 0] (G1-only)."
}
},
"description": "kind:'hermite' — start endpoint; point must match current pen position within 1e-6 mm."
},
"b": {
"type": "object",
"required": [
"point",
"tangent"
],
"properties": {
"point": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"description": "Endpoint position in mm."
},
"tangent": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"description": "First derivative (~ chord length), NOT unit length."
},
"curvature": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"description": "Optional second derivative; defaults to [0, 0] (G1-only)."
}
},
"description": "kind:'hermite' — end endpoint; pen ends at b.point."
},
"code": {
"type": "string",
"description": "The .kcad.ts source code."
},
"kind": {
"enum": [
"spline",
"nurbs",
"hermite"
],
"type": "string",
"description": "Which path-segment kind to append."
},
"knots": {
"type": "array",
"items": {
"type": "number"
},
"description": "kind:'nurbs' — optional explicit knot vector; length must equal control_points.length + degree + 1."
},
"degree": {
"type": "integer",
"minimum": 1,
"description": "kind:'nurbs' — B-spline degree (default 3)."
},
"points": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 2,
"minItems": 2
},
"minItems": 2,
"description": "kind:'spline' — waypoints as Vec2 pairs in mm; at least 2 entries; first must match current pen position."
},
"tension": {
"type": "number",
"description": "kind:'spline' — optional Catmull-Rom-style stiffness; forwarded to the underlying B-spline approximation."
},
"weights": {
"type": "array",
"items": {
"type": "number"
},
"description": "kind:'nurbs' — optional rational weights (one per control point; strictly positive)."
},
"end_tangent": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"description": "kind:'spline' — optional [x, y] direction vector at points[N-1]. Magnitude is normalised internally; direction matters."
},
"binding_name": {
"type": "string",
"description": "Reserved for future use; the segment injection mutates the chain anchor in place."
},
"chain_anchor": {
"type": "string",
"description": "JS identifier of an existing PathBuilder binding (e.g. `const brow = path().moveTo(0,0)`)."
},
"start_tangent": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"description": "kind:'spline' — optional [x, y] direction vector at points[0]. Magnitude is normalised internally; direction matters."
},
"control_points": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 2,
"minItems": 2
},
"description": "kind:'nurbs' — control-net vertices as Vec2 pairs in mm; at least degree+1 entries."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Add Path Segment",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to trace a reference image into normalized waypoints. Trace pixel-space features from a reference photo into normalized [0..1] waypoints the agent can map to mm via a known scale anchor and feed to path().spline / path().nurbsSegment. Three backends are dispatched behind the scenes: `opencv` (deterministic; uniform-bg silhouette only), `vision-llm` (vision model; named points/cluttered backgrounds; needs a configured vision endpoint), and `hybrid` (opencv silhouette + LLM-labeled named points). Default backend is `auto`. Per-feature confidence is reported. Pair with the `kernelcad-trace-from-image` skill for the conversion-to-mm pipeline. Hosted: give the file as an https:// URL, a data: URI (base64, max 25 MB) or "asset:<id>" from request_upload (when the file is on the user's device).
| Parameter | Type | Description |
|---|---|---|
| hint | string | Optional free-text hint forwarded to vision-LLM backends (e.g. "a pair of eyewear; trace the upper brow only"). |
| intent | string | 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. |
| priors | array | Caller-supplied category-norm defaults (e.g. wall thickness) recorded verbatim as `assumed` ledger facts. |
| backend | string | Force a specific backend; default `auto` routes by corner-color stddev. |
| features | array | Features to trace. Defaults to a single { label: "silhouette", kind: "silhouette" } when omitted. |
| validate | string | Assumption-ledger strictness. `warn` (default) never blocks. `error` fails the call when any `missing` ledger fact (e.g. scale) is still open. |
| image_url * | string | URL or path to the reference image. Supports file://, http(s)://, data:image/...;base64,..., or a bare filesystem path. |
| scale_anchor | object | Pixel-to-real-world scale anchor: two measured points on the image. Absent -> the returned ledger's `scale` fact is `missing`. |
| max_waypoints_per_feature | integer | Cap on waypoints per feature. Defaults to 12 (suitable for medium-inflection outlines). |
{
"name": "trace_from_image",
"title": "Trace Outline from Image",
"description": "Use this when you need to trace a reference image into normalized waypoints. Trace pixel-space features from a reference photo into normalized [0..1] waypoints the agent can map to mm via a known scale anchor and feed to path().spline / path().nurbsSegment. Three backends are dispatched behind the scenes: `opencv` (deterministic; uniform-bg silhouette only), `vision-llm` (vision model; named points/cluttered backgrounds; needs a configured vision endpoint), and `hybrid` (opencv silhouette + LLM-labeled named points). Default backend is `auto`. Per-feature confidence is reported. Pair with the `kernelcad-trace-from-image` skill for the conversion-to-mm pipeline. Hosted: give the file as an https:// URL, a data: URI (base64, max 25 MB) or \"asset:<id>\" from request_upload (when the file is on the user's device).",
"inputSchema": {
"type": "object",
"required": [
"image_url"
],
"properties": {
"hint": {
"type": "string",
"description": "Optional free-text hint forwarded to vision-LLM backends (e.g. \"a pair of eyewear; trace the upper brow only\")."
},
"intent": {
"type": "string",
"maxLength": 2000,
"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."
},
"priors": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"statement",
"value",
"confidence"
],
"properties": {
"id": {
"type": "string"
},
"value": {
"type": [
"string",
"number",
"boolean",
"array",
"object"
]
},
"statement": {
"type": "string"
},
"confidence": {
"type": "number",
"maximum": 1,
"minimum": 0
}
}
},
"description": "Caller-supplied category-norm defaults (e.g. wall thickness) recorded verbatim as `assumed` ledger facts."
},
"backend": {
"enum": [
"opencv",
"vision-llm",
"hybrid",
"auto"
],
"type": "string",
"description": "Force a specific backend; default `auto` routes by corner-color stddev."
},
"features": {
"type": "array",
"items": {
"type": "object",
"required": [
"label",
"kind"
],
"properties": {
"kind": {
"enum": [
"silhouette",
"curve",
"point",
"bbox"
],
"type": "string",
"description": "Geometric shape of the requested feature."
},
"label": {
"type": "string",
"description": "Caller-chosen identifier (echoed in the response)."
},
"region": {
"type": "string",
"description": "Optional free-text region hint forwarded to vision-LLM backends; ignored by opencv."
}
}
},
"description": "Features to trace. Defaults to a single { label: \"silhouette\", kind: \"silhouette\" } when omitted."
},
"validate": {
"enum": [
"warn",
"error"
],
"type": "string",
"description": "Assumption-ledger strictness. `warn` (default) never blocks. `error` fails the call when any `missing` ledger fact (e.g. scale) is still open."
},
"image_url": {
"type": "string",
"description": "URL or path to the reference image. Supports file://, http(s)://, data:image/...;base64,..., or a bare filesystem path."
},
"scale_anchor": {
"type": "object",
"required": [
"pixel_distance",
"real_distance",
"unit"
],
"properties": {
"unit": {
"enum": [
"mm",
"cm",
"in"
],
"type": "string"
},
"real_distance": {
"type": "number",
"description": "The same distance in real-world units."
},
"pixel_distance": {
"type": "number",
"description": "Distance in pixels between the two measured points."
}
},
"description": "Pixel-to-real-world scale anchor: two measured points on the image. Absent -> the returned ledger's `scale` fact is `missing`."
},
"max_waypoints_per_feature": {
"type": "integer",
"minimum": 2,
"description": "Cap on waypoints per feature. Defaults to 12 (suitable for medium-inflection outlines)."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Trace Outline from Image",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need an organic swept solid whose cross-section changes along its length — a tapering body, horn, bottle, handle, ring band, fairing, or duct — authored as a variable-section sweep along a spine. Inserts `variableSweep(spine, sections, opts?)` into the .kcad.ts `code` immediately before the last top-level return (an empty `code` starts a new script that returns the sweep). Spine: EITHER `spine_points` ([[x,y,z], ...] in mm, interpolated with spline3d; `spine_closed: true` closes the loop for a ring) OR `spine_binding` (an existing Curve3D / Sketch / Vec3[] variable). Each section: `t` in [0, 1] plus a profile — inline `radius` (circle) or `width` + `height` (rectangle), or `profile_binding` (an existing Sketch); profiles are centred on the spine and turned to face along it. Sections are strictly increasing in t, first t=0, last t=1 (omit t on every section to space them evenly). On a closed spine t=1 is the seam and reuses the t=0 profile. Example: { code, spine_points: [[0,0,0],[0,10,30],[0,0,60]], sections: [{ t: 0, radius: 8 }, { t: 0.5, radius: 10 }, { t: 1, radius: 4 }] }. Returns the modified code, diagnostics from re-evaluating it, and `sweep` { volumeMm3, bbox } measured from the built solid (ok:false when the sweep built nothing). The lowerer measures NURBS station seams for C1/C2 requests; C2 targets at least G2 and emits a warning with the achieved class if missed. The result is a Shape binding: return it, or chain `.union(...)` etc. via add_feature. Orientation is not exposed by this MCP tool until runtime orientation support is wired. Side-effect-free.
| Parameter | Type | Description |
|---|---|---|
| code * | string | The .kcad.ts source code ("" for a new script). |
| closed | boolean | Optional closed-sweep flag. |
| sections * | array | Varying cross-sections along the spine; at least 2 entries, strictly increasing in `t`, first t=0, last t=1. |
| continuity | string | Inter-section continuity request; default 'C1'. C2 targets measured G2 at NURBS station seams; output diagnostics report the achieved class. |
| binding_name | string | JS const name for the new Shape binding (default: _sweep_<N>). |
| spine_closed | boolean | With spine_points: close the spline into a loop (ring band, loop handle). |
| spine_points | array | Inline spine: at least 2 [x, y, z] points in mm, interpolated with spline3d. Use this OR spine_binding. |
| spine_binding | string | Existing variable name for a Curve3D / Sketch / Vec3[] declared earlier in the source. Use this OR spine_points. |
{
"name": "add_variable_sweep",
"title": "Add Variable Sweep",
"description": "Use this when you need an organic swept solid whose cross-section changes along its length — a tapering body, horn, bottle, handle, ring band, fairing, or duct — authored as a variable-section sweep along a spine. Inserts `variableSweep(spine, sections, opts?)` into the .kcad.ts `code` immediately before the last top-level return (an empty `code` starts a new script that returns the sweep). Spine: EITHER `spine_points` ([[x,y,z], ...] in mm, interpolated with spline3d; `spine_closed: true` closes the loop for a ring) OR `spine_binding` (an existing Curve3D / Sketch / Vec3[] variable). Each section: `t` in [0, 1] plus a profile — inline `radius` (circle) or `width` + `height` (rectangle), or `profile_binding` (an existing Sketch); profiles are centred on the spine and turned to face along it. Sections are strictly increasing in t, first t=0, last t=1 (omit t on every section to space them evenly). On a closed spine t=1 is the seam and reuses the t=0 profile. Example: { code, spine_points: [[0,0,0],[0,10,30],[0,0,60]], sections: [{ t: 0, radius: 8 }, { t: 0.5, radius: 10 }, { t: 1, radius: 4 }] }. Returns the modified code, diagnostics from re-evaluating it, and `sweep` { volumeMm3, bbox } measured from the built solid (ok:false when the sweep built nothing). The lowerer measures NURBS station seams for C1/C2 requests; C2 targets at least G2 and emits a warning with the achieved class if missed. The result is a Shape binding: return it, or chain `.union(...)` etc. via add_feature. Orientation is not exposed by this MCP tool until runtime orientation support is wired. Side-effect-free.",
"inputSchema": {
"type": "object",
"required": [
"code",
"sections"
],
"properties": {
"code": {
"type": "string",
"description": "The .kcad.ts source code (\"\" for a new script)."
},
"closed": {
"type": "boolean",
"description": "Optional closed-sweep flag."
},
"sections": {
"type": "array",
"items": {
"type": "object",
"properties": {
"t": {
"type": "number",
"description": "Spine parameter in [0, 1]."
},
"width": {
"type": "number",
"description": "Inline rectangular profile width, mm (with height)."
},
"height": {
"type": "number",
"description": "Inline rectangular profile height, mm (with width)."
},
"radius": {
"type": "number",
"description": "Inline circular profile radius, mm."
},
"profile_binding": {
"type": "string",
"description": "Existing Sketch variable name for this section (instead of radius / width+height)."
}
}
},
"description": "Varying cross-sections along the spine; at least 2 entries, strictly increasing in `t`, first t=0, last t=1."
},
"continuity": {
"enum": [
"C0",
"C1",
"C2"
],
"type": "string",
"description": "Inter-section continuity request; default 'C1'. C2 targets measured G2 at NURBS station seams; output diagnostics report the achieved class."
},
"binding_name": {
"type": "string",
"description": "JS const name for the new Shape binding (default: _sweep_<N>)."
},
"spine_closed": {
"type": "boolean",
"description": "With spine_points: close the spline into a loop (ring band, loop handle)."
},
"spine_points": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
},
"description": "Inline spine: at least 2 [x, y, z] points in mm, interpolated with spline3d. Use this OR spine_binding."
},
"spine_binding": {
"type": "string",
"description": "Existing variable name for a Curve3D / Sketch / Vec3[] declared earlier in the source. Use this OR spine_points."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Add Variable Sweep",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to author text into a kernelCAD script before the last top-level return. One authoring path, selected by `mode`: - 'sketch' — insert a sketch.text(...) call. The emitted sketch is chainable: pair with subsequent .extrude(...) / cut(...) edits to land an engraved or raised text feature. - 'emboss' — insert a `<shape>.embossText({...})` chained call onto an existing Shape `target`. Use for engraved brand text on faces (Ray-Ban temple, CE mark, model number). `depth > 0` raises text out of the face; `depth < 0` engraves text into the face. Lowers via replicad drawText → sketchOnFace → extrude → fuse|cut. Default font is the runtime-bundled Liberation Sans. Side-effect-free; returns the modified code plus diagnostics from re-evaluating. Each mode fails closed on its own missing required params.
| Parameter | Type | Description |
|---|---|---|
| code * | string | The .kcad.ts source code. |
| face | string | mode:'emboss' — target face — canonical name ('top'/'bottom'/'left'/'right'/'front'/'back') or label. |
| font | string | mode:'sketch' — optional logical font name or .ttf file path; defaults to bundled Liberation Sans. |
| mode * | string | Which text-authoring path to use. |
| size | number | mode:'sketch'|'emboss' — glyph cap height in mm (positive finite). |
| align | string | mode:'sketch' — horizontal alignment relative to position (default left); mode:'emboss' — relative to the UV anchor (default center). |
| depth | number | mode:'emboss' — signed extrusion depth in mm: positive emboss out, negative engrave in. Must be non-zero. |
| target | string | mode:'emboss' — variable name of the Shape to chain onto (inserted verbatim). |
| bind_as | string | mode:'sketch' — emits `const <bind_as> = sketch.text(...)`; mode:'emboss' — emits `const <bind_as> = <target>.embossText(...);`. |
| content | string | mode:'sketch' — text content (UTF-8, non-empty, non-whitespace). |
| anchor_u | number | mode:'emboss' — U anchor in [0, 1] face-local (0=umin, 0.5=centre, 1=umax). Default 0.5. |
| anchor_v | number | mode:'emboss' — V anchor in [0, 1] face-local. Default 0.5. |
| position | array | mode:'sketch' — [x, y] anchor in mm. Default [0, 0]. |
| rotation | number | mode:'sketch' — CCW rotation in degrees around position (default 0); mode:'emboss' — CCW rotation in the face tangent plane (default 0). |
| scale_mode | string | mode:'emboss' — Drawing.sketchOnFace scaling mode. Default original. |
| font_family | string | mode:'emboss' — optional logical font name or .ttf file path; defaults to bundled Liberation Sans. |
| text_content | string | mode:'emboss' — text content (UTF-8, non-empty, non-whitespace). |
{
"name": "add_text",
"title": "Add Text",
"description": "Use this when you need to author text into a kernelCAD script before the last top-level return. One authoring path, selected by `mode`:\n- 'sketch' — insert a sketch.text(...) call. The emitted sketch is chainable: pair with subsequent .extrude(...) / cut(...) edits to land an engraved or raised text feature.\n- 'emboss' — insert a `<shape>.embossText({...})` chained call onto an existing Shape `target`. Use for engraved brand text on faces (Ray-Ban temple, CE mark, model number). `depth > 0` raises text out of the face; `depth < 0` engraves text into the face. Lowers via replicad drawText → sketchOnFace → extrude → fuse|cut.\nDefault font is the runtime-bundled Liberation Sans. Side-effect-free; returns the modified code plus diagnostics from re-evaluating. Each mode fails closed on its own missing required params.",
"inputSchema": {
"type": "object",
"required": [
"mode",
"code"
],
"properties": {
"code": {
"type": "string",
"description": "The .kcad.ts source code."
},
"face": {
"type": "string",
"description": "mode:'emboss' — target face — canonical name ('top'/'bottom'/'left'/'right'/'front'/'back') or label."
},
"font": {
"type": "string",
"description": "mode:'sketch' — optional logical font name or .ttf file path; defaults to bundled Liberation Sans."
},
"mode": {
"enum": [
"sketch",
"emboss"
],
"type": "string",
"description": "Which text-authoring path to use."
},
"size": {
"type": "number",
"description": "mode:'sketch'|'emboss' — glyph cap height in mm (positive finite)."
},
"align": {
"enum": [
"left",
"center",
"right"
],
"type": "string",
"description": "mode:'sketch' — horizontal alignment relative to position (default left); mode:'emboss' — relative to the UV anchor (default center)."
},
"depth": {
"type": "number",
"description": "mode:'emboss' — signed extrusion depth in mm: positive emboss out, negative engrave in. Must be non-zero."
},
"target": {
"type": "string",
"description": "mode:'emboss' — variable name of the Shape to chain onto (inserted verbatim)."
},
"bind_as": {
"type": "string",
"description": "mode:'sketch' — emits `const <bind_as> = sketch.text(...)`; mode:'emboss' — emits `const <bind_as> = <target>.embossText(...);`."
},
"content": {
"type": "string",
"description": "mode:'sketch' — text content (UTF-8, non-empty, non-whitespace)."
},
"anchor_u": {
"type": "number",
"description": "mode:'emboss' — U anchor in [0, 1] face-local (0=umin, 0.5=centre, 1=umax). Default 0.5."
},
"anchor_v": {
"type": "number",
"description": "mode:'emboss' — V anchor in [0, 1] face-local. Default 0.5."
},
"position": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"description": "mode:'sketch' — [x, y] anchor in mm. Default [0, 0]."
},
"rotation": {
"type": "number",
"description": "mode:'sketch' — CCW rotation in degrees around position (default 0); mode:'emboss' — CCW rotation in the face tangent plane (default 0)."
},
"scale_mode": {
"enum": [
"original",
"native",
"bounds"
],
"type": "string",
"description": "mode:'emboss' — Drawing.sketchOnFace scaling mode. Default original."
},
"font_family": {
"type": "string",
"description": "mode:'emboss' — optional logical font name or .ttf file path; defaults to bundled Liberation Sans."
},
"text_content": {
"type": "string",
"description": "mode:'emboss' — text content (UTF-8, non-empty, non-whitespace)."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Add Text",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to project a 2D path onto a selected face. Insert `<shape>.projectCurve(...)` into a kernelCAD script. Closed mode wraps a path and returns a Sketch. Open mode (`as_edge: true`) takes an explicit `source_plane` and world-space `direction`, awaits the projection, and binds every resulting edge as a Curve3D array for downstream curve operations. The source is `{ kind: "sketchCommands", commands: [...] }`. Side-effect-free; returns modified code plus diagnostics.
| Parameter | Type | Description |
|---|---|---|
| code * | string | The .kcad.ts source code. |
| face * | string | Target face — canonical name or label. |
| target * | string | Variable name of the Shape to chain onto. |
| as_edge | boolean | Open-wire projection. When true, commands must be open, source_plane and direction are required, and bind_as receives an awaited Curve3D[] result. |
| bind_as | string | Optional local variable name; emits a const binding (awaited when as_edge is true). |
| commands * | array | 2D path as plain-number commands. Closed mode starts with moveTo and ends with close; open mode starts with moveTo, has one or more segments, and has no close. |
| direction | array | Required with as_edge:true. Non-zero world-space projection direction. |
| scale_mode | string | Closed projection Drawing.sketchOnFace scaling mode. Default original. |
| source_plane | object | Required with as_edge:true. Places the 2D source path in world space; origin is in mm and x_axis/normal define its frame. |
{
"name": "project_curve",
"title": "Project Curve",
"description": "Use this when you need to project a 2D path onto a selected face. Insert `<shape>.projectCurve(...)` into a kernelCAD script. Closed mode wraps a path and returns a Sketch. Open mode (`as_edge: true`) takes an explicit `source_plane` and world-space `direction`, awaits the projection, and binds every resulting edge as a Curve3D array for downstream curve operations. The source is `{ kind: \"sketchCommands\", commands: [...] }`. Side-effect-free; returns modified code plus diagnostics.",
"inputSchema": {
"type": "object",
"allOf": [
{
"if": {
"required": [
"as_edge"
],
"properties": {
"as_edge": {
"const": true
}
}
},
"then": {
"not": {
"required": [
"scale_mode"
]
},
"required": [
"source_plane",
"direction"
]
}
},
{
"if": {
"anyOf": [
{
"required": [
"source_plane"
]
},
{
"required": [
"direction"
]
}
]
},
"then": {
"required": [
"as_edge"
],
"properties": {
"as_edge": {
"const": true
}
}
}
}
],
"required": [
"code",
"target",
"commands",
"face"
],
"properties": {
"code": {
"type": "string",
"description": "The .kcad.ts source code."
},
"face": {
"type": "string",
"description": "Target face — canonical name or label."
},
"target": {
"type": "string",
"description": "Variable name of the Shape to chain onto."
},
"as_edge": {
"type": "boolean",
"description": "Open-wire projection. When true, commands must be open, source_plane and direction are required, and bind_as receives an awaited Curve3D[] result."
},
"bind_as": {
"type": "string",
"description": "Optional local variable name; emits a const binding (awaited when as_edge is true)."
},
"commands": {
"type": "array",
"items": {
"type": "object",
"required": [
"kind"
],
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"kind": {
"enum": [
"moveTo",
"lineTo",
"close"
],
"type": "string"
}
}
},
"description": "2D path as plain-number commands. Closed mode starts with moveTo and ends with close; open mode starts with moveTo, has one or more segments, and has no close."
},
"direction": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "Required with as_edge:true. Non-zero world-space projection direction."
},
"scale_mode": {
"enum": [
"original",
"native",
"bounds"
],
"type": "string",
"description": "Closed projection Drawing.sketchOnFace scaling mode. Default original."
},
"source_plane": {
"type": "object",
"required": [
"origin",
"normal",
"x_axis"
],
"properties": {
"normal": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
},
"origin": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
},
"x_axis": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
}
},
"description": "Required with as_edge:true. Places the 2D source path in world space; origin is in mm and x_axis/normal define its frame."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Project Curve",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to repeat a feature in a pattern. Insert a Shape.patternLinear / .patternCircular / .patternGrid / .patternCurve call into a kernelCAD script before the last top-level return. Pass structured args (kind + the matching spec object). Curve patterns use equal arc-length intervals along a 3D polyline; instances keep the seed orientation. Returns the modified code plus diagnostics from re-evaluating. Side-effect-free. The pattern feature is a single editable unit; pattern-instance face refs resolve via `<sourceId>_pattern_<i>` on the pattern feature's lineage. Geometric note: pattern is implemented as cumulative boolean union of transformed source copies — additive features (boxes, ribs, fins, spokes) pattern cleanly; patterning a subtractive feature (hole, cutout) only preserves the per-instance void when adjacent bodies are disjoint.
| Parameter | Type | Description |
|---|---|---|
| code * | string | The .kcad.ts source code. |
| grid | object | Required when kind=grid. |
| kind * | string | one of ["linear","circular","grid","curve"] |
| curve | object | Required when kind=curve. A fixed-orientation pattern at equal arc-length intervals along a polyline. Points are offsets in mm from the seed; the first point must be [0, 0, 0]. |
| linear | object | Required when kind=linear. |
| target * | string | Variable name of the Shape to pattern (inserted verbatim as the LHS receiver). |
| circular | object | Required when kind=circular. |
| assign_to | string | Optional const-binding name; emits `const <assign_to> = <target>.patternX(...);`. Omit for statement form. |
{
"name": "add_pattern_feature",
"title": "Add Pattern Feature",
"description": "Use this when you need to repeat a feature in a pattern. Insert a Shape.patternLinear / .patternCircular / .patternGrid / .patternCurve call into a kernelCAD script before the last top-level return. Pass structured args (kind + the matching spec object). Curve patterns use equal arc-length intervals along a 3D polyline; instances keep the seed orientation. Returns the modified code plus diagnostics from re-evaluating. Side-effect-free. The pattern feature is a single editable unit; pattern-instance face refs resolve via `<sourceId>_pattern_<i>` on the pattern feature's lineage. Geometric note: pattern is implemented as cumulative boolean union of transformed source copies — additive features (boxes, ribs, fins, spokes) pattern cleanly; patterning a subtractive feature (hole, cutout) only preserves the per-instance void when adjacent bodies are disjoint.",
"inputSchema": {
"type": "object",
"allOf": [
{
"if": {
"properties": {
"kind": {
"const": "linear"
}
}
},
"then": {
"required": [
"linear"
]
}
},
{
"if": {
"properties": {
"kind": {
"const": "circular"
}
}
},
"then": {
"required": [
"circular"
]
}
},
{
"if": {
"properties": {
"kind": {
"const": "grid"
}
}
},
"then": {
"required": [
"grid"
]
}
},
{
"if": {
"properties": {
"kind": {
"const": "curve"
}
}
},
"then": {
"required": [
"curve"
]
}
}
],
"required": [
"code",
"target",
"kind"
],
"properties": {
"code": {
"type": "string",
"description": "The .kcad.ts source code."
},
"grid": {
"type": "object",
"required": [
"x",
"y"
],
"properties": {
"x": {
"type": "object",
"required": [
"count",
"direction",
"spacing"
],
"properties": {
"count": {
"type": "integer",
"minimum": 2
},
"spacing": {
"type": "number"
},
"direction": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
}
},
"description": "First grid axis."
},
"y": {
"type": "object",
"required": [
"count",
"direction",
"spacing"
],
"properties": {
"count": {
"type": "integer",
"minimum": 2
},
"spacing": {
"type": "number"
},
"direction": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
}
},
"description": "Second grid axis."
}
},
"description": "Required when kind=grid."
},
"kind": {
"enum": [
"linear",
"circular",
"grid",
"curve"
],
"type": "string"
},
"curve": {
"type": "object",
"required": [
"count",
"points"
],
"properties": {
"count": {
"type": "integer",
"minimum": 2
},
"points": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
},
"minItems": 2
}
},
"description": "Required when kind=curve. A fixed-orientation pattern at equal arc-length intervals along a polyline. Points are offsets in mm from the seed; the first point must be [0, 0, 0]."
},
"linear": {
"type": "object",
"required": [
"count",
"direction",
"spacing"
],
"properties": {
"count": {
"type": "integer",
"minimum": 2
},
"spacing": {
"type": "number"
},
"direction": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
}
},
"description": "Required when kind=linear."
},
"target": {
"type": "string",
"description": "Variable name of the Shape to pattern (inserted verbatim as the LHS receiver)."
},
"circular": {
"type": "object",
"required": [
"count",
"axis"
],
"properties": {
"axis": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
},
"count": {
"type": "integer",
"minimum": 2
},
"angle_deg": {
"type": "number",
"description": "Optional; defaults to 360."
}
},
"description": "Required when kind=circular."
},
"assign_to": {
"type": "string",
"description": "Optional const-binding name; emits `const <assign_to> = <target>.patternX(...);`. Omit for statement form."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Add Pattern Feature",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to remove a feature line from a script. Remove a single line from a kernelCAD script identified by a substring match. Returns the modified code plus diagnostics from re-evaluating. Refuses to remove the line containing the return statement. Side-effect-free.
| Parameter | Type | Description |
|---|---|---|
| code * | string | The .kcad.ts source code. |
| match * | string | A substring that uniquely identifies the line to remove (e.g. `const hole = cylinder(5,`). |
{
"name": "remove_feature",
"title": "Remove Feature",
"description": "Use this when you need to remove a feature line from a script. Remove a single line from a kernelCAD script identified by a substring match. Returns the modified code plus diagnostics from re-evaluating. Refuses to remove the line containing the return statement. Side-effect-free.",
"inputSchema": {
"type": "object",
"required": [
"code",
"match"
],
"properties": {
"code": {
"type": "string",
"description": "The .kcad.ts source code."
},
"match": {
"type": "string",
"description": "A substring that uniquely identifies the line to remove (e.g. `const hole = cylinder(5,`)."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Remove Feature",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": true
}
}Use this when you need to resolve or inspect topology against a script's lowered geometry. Pass the script as `code` (inline; works on a hosted server) or `file`. Selected by `mode` (default 'evaluate'): - 'evaluate' — list the faces a Query matches ({ query }). Pass expect:'unique' to assert exactly-one. - 'resolve' — resolve one ref to one face ({ ref }). - 'lineage' — the creating/modifying history of a face ({ ref }; feature_id defaults to the last feature). Query forms (faces only; edge/vertex kinds return query.unsupported-entity-type): - a bare face label: 'top', 'bottom', 'left', 'right', 'front', 'back', or a hole/cutout slot like 'wall'. - @kc[<feature-id>/face/<label>] — feature ids are the ones refs print, e.g. '@kc[box_1/face/top]', '@kc[hole_1/face/wall]'. - @kcq[face(<filter>, ...)] — filters AND together: createdBy("box_1"), withLabel("top"), geometryType(PLANE|CYLINDER|CONE|SPHERE|TORUS|BSPLINE_SURFACE), closestTo([x,y,z]) or closestTo([x,y,z], k), containsPoint([x,y,z]); combine with union(a, b), intersection(a, b), subtraction(a, b). Example: '@kcq[face(geometryType(CYLINDER), closestTo([0,0,10]))]'. Each matched face comes back with its canonical @kc ref, centroid, normal and area.
| Parameter | Type | Description |
|---|---|---|
| ref | string | mode:'resolve'|'lineage' — one face: '@kc[box_1/face/top]', '@kcq[...]', or '<feature-id>.<label>' (lineage). |
| code | string | Inline kernelCAD script source. |
| file | string | Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| mode | string | Resolution mode (default 'evaluate'). |
| query | ["string","object"] | mode:'evaluate' — Query: a bare face label ('top'), an @kc[<feature-id>/face/<label>] ref, an @kcq[face(...)] expression, or { ast }. |
| expect | string | mode:'evaluate' — 'unique' asserts exactly-one. |
| feature_id | string | Optional FeatureId; defaults to the last lowered shape (use "auto" for lineage). |
{
"name": "query",
"title": "Query Geometry",
"description": "Use this when you need to resolve or inspect topology against a script's lowered geometry. Pass the script as `code` (inline; works on a hosted server) or `file`. Selected by `mode` (default 'evaluate'):\n- 'evaluate' — list the faces a Query matches ({ query }). Pass expect:'unique' to assert exactly-one.\n- 'resolve' — resolve one ref to one face ({ ref }).\n- 'lineage' — the creating/modifying history of a face ({ ref }; feature_id defaults to the last feature).\nQuery forms (faces only; edge/vertex kinds return query.unsupported-entity-type):\n- a bare face label: 'top', 'bottom', 'left', 'right', 'front', 'back', or a hole/cutout slot like 'wall'.\n- @kc[<feature-id>/face/<label>] — feature ids are the ones refs print, e.g. '@kc[box_1/face/top]', '@kc[hole_1/face/wall]'.\n- @kcq[face(<filter>, ...)] — filters AND together: createdBy(\"box_1\"), withLabel(\"top\"), geometryType(PLANE|CYLINDER|CONE|SPHERE|TORUS|BSPLINE_SURFACE), closestTo([x,y,z]) or closestTo([x,y,z], k), containsPoint([x,y,z]); combine with union(a, b), intersection(a, b), subtraction(a, b). Example: '@kcq[face(geometryType(CYLINDER), closestTo([0,0,10]))]'.\nEach matched face comes back with its canonical @kc ref, centroid, normal and area.",
"inputSchema": {
"type": "object",
"properties": {
"ref": {
"type": "string",
"description": "mode:'resolve'|'lineage' — one face: '@kc[box_1/face/top]', '@kcq[...]', or '<feature-id>.<label>' (lineage)."
},
"code": {
"type": "string",
"description": "Inline kernelCAD script source."
},
"file": {
"type": "string",
"description": "Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"mode": {
"enum": [
"evaluate",
"resolve",
"lineage"
],
"type": "string",
"description": "Resolution mode (default 'evaluate')."
},
"query": {
"type": [
"string",
"object"
],
"description": "mode:'evaluate' — Query: a bare face label ('top'), an @kc[<feature-id>/face/<label>] ref, an @kcq[face(...)] expression, or { ast }."
},
"expect": {
"enum": [
"any",
"unique"
],
"type": "string",
"description": "mode:'evaluate' — 'unique' asserts exactly-one."
},
"feature_id": {
"type": "string",
"description": "Optional FeatureId; defaults to the last lowered shape (use \"auto\" for lineage)."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Query Geometry",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Look up the kernelCAD script API by symbol, plain-language query, and/or section. Plain-language matches are ranked across sections. Results contain exact runtime signatures. All matching entries are returned by default; set limit and offset only when you want pages. Omit query and section for the compact API index and section counts. Use query to request full descriptions of matching entries. intent is telemetry, not a search query. Lookup responses include `kernelSource`: the exact kernel package version/revision, composed runtime source hash, and version-pinned public authoring/API references.
| Parameter | Type | Description |
|---|---|---|
| limit | integer | Optional entries per page; omit to return every match. |
| query | string | API symbol or plain-language terms; matching entries retain full descriptions. |
| intent | string | 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. |
| offset | integer | Continue from next_offset with the same query and section. |
| section | string | Restrict results to one section from the returned section index. |
{
"name": "lookup_api",
"title": "Look Up API",
"description": "Look up the kernelCAD script API by symbol, plain-language query, and/or section. Plain-language matches are ranked across sections. Results contain exact runtime signatures. All matching entries are returned by default; set limit and offset only when you want pages. Omit query and section for the compact API index and section counts. Use query to request full descriptions of matching entries. intent is telemetry, not a search query. Lookup responses include `kernelSource`: the exact kernel package version/revision, composed runtime source hash, and version-pinned public authoring/API references.",
"inputSchema": {
"type": "object",
"properties": {
"limit": {
"type": "integer",
"minimum": 1,
"description": "Optional entries per page; omit to return every match."
},
"query": {
"type": "string",
"description": "API symbol or plain-language terms; matching entries retain full descriptions."
},
"intent": {
"type": "string",
"maxLength": 2000,
"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."
},
"offset": {
"type": "integer",
"default": 0,
"minimum": 0,
"description": "Continue from next_offset with the same query and section."
},
"section": {
"enum": [
"globals",
"shapeMethods",
"shapeListMethods",
"sketchMethods",
"pathBuilderMethods",
"paramRefMethods",
"sceneMethods",
"scenePartProperties",
"surfaceMethods",
"curve3dMethods",
"curve3dAnalyticsMethods",
"edgeQueryKeys",
"faceQueryKeys",
"featureKindFaceLabels",
"constraints"
],
"type": "string",
"description": "Restrict results to one section from the returned section index."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Look Up API",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Look up a diagnostic code for its explanation and recovery action. Pass code for one exact entry, or omit it for the full catalogue.
| Parameter | Type | Description |
|---|---|---|
| code | string | Exact diagnostic code from the tool response, such as feature.invalid-args. |
{
"name": "lookup_diagnostics",
"title": "Look Up Diagnostics",
"description": "Look up a diagnostic code for its explanation and recovery action. Pass code for one exact entry, or omit it for the full catalogue.",
"inputSchema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Exact diagnostic code from the tool response, such as feature.invalid-args."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Look Up Diagnostics",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to export geometry to a file. One exporter, selected by `target`: - target:'model' — export the script geometry to one file. Pass { file | code }, a required { output_path }, and { format }. Supported formats: stl (binary STL mesh), step (BREP CAD interchange), dxf (2D cut file for laser / waterjet / CNC: a flat part — plate, panel, extruded profile, in any orientation — exports its outline and holes in its own plane with exact arcs and circles; a sheet-metal part or a returned Region exports its flat pattern; a flat or sheet-metal part also returns sheet { thickness_mm, bend_count }, which a shop needs and the DXF does not carry; options.section { axis: "x"|"y"|"z", at } exports the cross-section of any part in world coordinates (plans, profiles); a multi-part model (cut list) writes all parts side by side on output_path, one layer per part, plus parts/<part>.dxf per part (reported in part_files; options.layout 'sheet' writes the combined sheet only); a 3D part that is not a flat plate or panel fails with export.dxf.non-planar), 3mf (slicer-friendly mesh: one named object per part, colours as core-spec basematerials named by the part's engineering material; options.arrange 'plate' packs parts on the bed at Z=0 without overlap (options.orient puts each part's largest flat face down), 'assembled' keeps them together as one multi-part object for multi-colour prints; options.slicer 'bambu' | 'orca' | 'prusa' adds that slicer's per-object name + filament-slot sidecar — slot N is the Nth distinct colour/material), options.infill { fromFea: '<study>' | true, bands?, pattern? } = stress-graded FDM infill (requires the local CalculiX + gmsh toolchain; without it the export fails with fea.solver.unavailable): solves the feaStudy and writes modifier volumes, each with its own infill density (Orca/Bambu format by default; options.slicer 'prusa' writes PrusaSlicer's format instead, since the two are not interchangeable); the result carries infill { bands, saving, images }), gcode (installed OrcaSlicer output; preserves G-code and returns optional gcode_stats with header generator identity and slicer-predicted time/material), glb (web-viewer / AR with PBR materials), asset-pack (deterministic zip of the script when the licence allows it, a default-parameter GLB, params JSON, README, SPDX licence, three.js viewer and sha256 manifest), obj (Wavefront indexed triangle mesh), ply (Stanford PLY triangle mesh, mm, Z-up, binary little-endian by default, with per-vertex normals and the part colour from .finish()/.material()/.color(); an assembly is one file with every part in world space), usd (ASCII USDA triangle mesh in millimeter, Z-up coordinates, with face-varying normals split at edges sharper than 30°; multi-part scenes emit one named mesh per part), svg-drawing (third-angle engineering-drawing sheet: front/top/left + isometric views, hidden edges dashed, tangent edges thin, overall bounding-box dimensions, title block; assemblies are drawn with inter-part occlusion; pass options.annotations to dimension specific features instead of the bounding box; pass options.exploded { factor, mode } to explode the isometric cell, options.balloons to number parts from the BOM, and options.partsList for an item/name/qty/material table above the title block). overall bounding-box dimensions, title block; assemblies are drawn with inter-part occlusion; pass options.annotations to dimension specific features instead of the bounding box, options.autoAnnotate to derive datums A/B/C, grouped hole callouts with position tolerances, hole positions, overall size, radius and chamfer callouts, flatness and an ISO 2768 note from the geometry (the result carries drawing_report with placed / overlapped counts), and options.sections for real section views on any cutting plane). pdf-drawing (the same sheet — views, dashed hidden lines, dimensions, hole callouts, GD&T, sections, parts list — as a printable vector PDF on a standard sheet, one call:
| Parameter | Type | Description |
|---|---|---|
| code | string | Inline kernelCAD script source. |
| file | string | Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| part | string | target:'part' — part name for single-part export, or 'all'. |
| format | string | target:'model' — output file format (required for that target). |
| intent | string | 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. |
| job_id | string | Poll an existing hosted export job using the job_id returned by export.deferred. Pass only job_id to retrieve its status or completed downloads. |
| target | string | Which exporter to run: 'model' (whole-script geometry to one file) or 'part' (per-part STLs from a solved assembly). |
| options | object | target:'model' — optional per-format options bag. The top-level format selects these options. If supplied, options.format must match it. step: { unit?: "mm"|"cm"|"in", verify?: boolean } (verify defaults to true and checks B-rep validity plus mesh watertightness; false skips both). stl: { verify?: b… |
| no_verify | boolean | Skip the default STL/STEP validity and watertightness gates. |
| feature_id | string | target:'model' — optional FeatureId to export; defaults to last. |
{
"name": "export",
"title": "Export",
"description": "Use this when you need to export geometry to a file. One exporter, selected by `target`:\n- target:'model' — export the script geometry to one file. Pass { file | code }, a required { output_path }, and { format }. Supported formats: stl (binary STL mesh), step (BREP CAD interchange), dxf (2D cut file for laser / waterjet / CNC: a flat part — plate, panel, extruded profile, in any orientation — exports its outline and holes in its own plane with exact arcs and circles; a sheet-metal part or a returned Region exports its flat pattern; a flat or sheet-metal part also returns sheet { thickness_mm, bend_count }, which a shop needs and the DXF does not carry; options.section { axis: \"x\"|\"y\"|\"z\", at } exports the cross-section of any part in world coordinates (plans, profiles); a multi-part model (cut list) writes all parts side by side on output_path, one layer per part, plus parts/<part>.dxf per part (reported in part_files; options.layout 'sheet' writes the combined sheet only); a 3D part that is not a flat plate or panel fails with export.dxf.non-planar), 3mf (slicer-friendly mesh: one named object per part, colours as core-spec basematerials named by the part's engineering material; options.arrange 'plate' packs parts on the bed at Z=0 without overlap (options.orient puts each part's largest flat face down), 'assembled' keeps them together as one multi-part object for multi-colour prints; options.slicer 'bambu' | 'orca' | 'prusa' adds that slicer's per-object name + filament-slot sidecar — slot N is the Nth distinct colour/material), options.infill { fromFea: '<study>' | true, bands?, pattern? } = stress-graded FDM infill (requires the local CalculiX + gmsh toolchain; without it the export fails with fea.solver.unavailable): solves the feaStudy and writes modifier volumes, each with its own infill density (Orca/Bambu format by default; options.slicer 'prusa' writes PrusaSlicer's format instead, since the two are not interchangeable); the result carries infill { bands, saving, images }), gcode (installed OrcaSlicer output; preserves G-code and returns optional gcode_stats with header generator identity and slicer-predicted time/material), glb (web-viewer / AR with PBR materials), asset-pack (deterministic zip of the script when the licence allows it, a default-parameter GLB, params JSON, README, SPDX licence, three.js viewer and sha256 manifest), obj (Wavefront indexed triangle mesh), ply (Stanford PLY triangle mesh, mm, Z-up, binary little-endian by default, with per-vertex normals and the part colour from .finish()/.material()/.color(); an assembly is one file with every part in world space), usd (ASCII USDA triangle mesh in millimeter, Z-up coordinates, with face-varying normals split at edges sharper than 30°; multi-part scenes emit one named mesh per part), svg-drawing (third-angle engineering-drawing sheet: front/top/left + isometric views, hidden edges dashed, tangent edges thin, overall bounding-box dimensions, title block; assemblies are drawn with inter-part occlusion; pass options.annotations to dimension specific features instead of the bounding box; pass options.exploded { factor, mode } to explode the isometric cell, options.balloons to number parts from the BOM, and options.partsList for an item/name/qty/material table above the title block). overall bounding-box dimensions, title block; assemblies are drawn with inter-part occlusion; pass options.annotations to dimension specific features instead of the bounding box, options.autoAnnotate to derive datums A/B/C, grouped hole callouts with position tolerances, hole positions, overall size, radius and chamfer callouts, flatness and an ISO 2768 note from the geometry (the result carries drawing_report with placed / overlapped counts), and options.sections for real section views on any cutting plane). pdf-drawing (the same sheet — views, dashed hidden lines, dimensions, hole callouts, GD&T, sections, parts list — as a printable vector PDF on a standard sheet, one call:",
"inputSchema": {
"type": "object",
"allOf": [
{
"anyOf": [
{
"required": [
"job_id"
]
},
{
"required": [
"target"
]
}
]
}
],
"required": [],
"properties": {
"code": {
"type": "string",
"description": "Inline kernelCAD script source."
},
"file": {
"type": "string",
"description": "Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"part": {
"type": "string",
"description": "target:'part' — part name for single-part export, or 'all'."
},
"format": {
"enum": [
"stl",
"step",
"dxf",
"3mf",
"glb",
"asset-pack",
"obj",
"ply",
"usd",
"svg-drawing",
"pdf-drawing",
"urdf",
"srdf",
"sdf-gazebo",
"usd-isaac",
"bom-csv",
"bom-json",
"order-pack",
"bend-table",
"gcode"
],
"type": "string",
"description": "target:'model' — output file format (required for that target)."
},
"intent": {
"type": "string",
"maxLength": 2000,
"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."
},
"job_id": {
"type": "string",
"pattern": "\\S",
"description": "Poll an existing hosted export job using the job_id returned by export.deferred. Pass only job_id to retrieve its status or completed downloads."
},
"target": {
"enum": [
"model",
"part"
],
"type": "string",
"description": "Which exporter to run: 'model' (whole-script geometry to one file) or 'part' (per-part STLs from a solved assembly)."
},
"options": {
"type": "object",
"description": "target:'model' — optional per-format options bag. The top-level format selects these options. If supplied, options.format must match it. step: { unit?: \"mm\"|\"cm\"|\"in\", verify?: boolean } (verify defaults to true and checks B-rep validity plus mesh watertightness; false skips both). stl: { verify?: boolean, tolerance?: mm (finite, >= 0.001; absolute sampled chord-deviation target), angularToleranceDeg?: degrees }. dxf: { layers?, unit?: \"mm\"|\"cm\"|\"in\", tolerance?, section?: { axis: \"x\"|\"y\"|\"z\", at: mm }, sectionLayers?: { axis: \"x\"|\"y\"|\"z\", layers: [{ name, at: mm, omitSharedWith?: earlier layer name }] }, layout?: \"per-part\"|\"sheet\" }. Use sectionLayers on one selected solid to write explicit section planes into named layers. omitSharedWith removes congruent closed contours from the named earlier layer and fails if any are missing. Section planes and layer names are supplied by the caller. 3mf: { tolerance?: mm (finite, >= 0.001), angularToleranceDeg?: degrees, printUnit?: \"mm\"|\"cm\"|\"in\", embedSource?, arrange?: \"none\"|\"plate\"|\"assembled\", orient?: boolean, slicer?: \"generic\"|\"bambu\"|\"orca\"|\"prusa\", printer?: printer profile id, one of \"generic-fdm\"|\"bambu-a1-mini\"|\"bambu-a1\"|\"bambu-p1s\"|\"bambu-p1p\"|\"bambu-x1c\"|\"bambu-x1e\"|\"bambu-h2d\"|\"bambu-h2s\"|\"prusa-mini-plus\"|\"prusa-mk4s\"|\"prusa-core-one\"|\"prusa-xl\"|\"creality-ender-3-v3\"|\"creality-k1\"|\"creality-k1-max\"|\"creality-k2-plus\"|\"elegoo-neptune-4-pro\"|\"anycubic-kobra-3\"|\"voron-2.4-250\"|\"voron-2.4-300\"|\"voron-2.4-350\"|\"ultimaker-s5\" (default \"generic-fdm\"; sets the bed for arrange and the slicer default; an unknown id is refused with the valid list; CLI: kernelcad print printers) }; parts that do not fit the bed are still written and reported as warn diagnostics export.3mf.plate-overflow / export.3mf.exceeds-bed, whose hint names the smallest profiles the layout fits on. gcode: { printer?: printer profile id, layerHeight?: mm, infill?: percent, supports?: boolean, material?: string }; requires a locally installed OrcaSlicer. Returns slicer predictions as gcode_stats; does not start a printer. glb: { axis?: \"y-up\"|\"z-up\", draco?: false, style?: \"pbr\"|\"lowpoly\", lowpoly?: { angularDeg?: 5..60 (default 30, about 12 segments per circle), maxTriangles?: number }, units?: \"mm\"|\"m\" (default \"m\", the glTF length unit) }. Both GLB styles default to metres and scale kernelCAD millimetre geometry at the scene root, so standard glTF viewers show the authored physical size. units:\"mm\" keeps raw millimetre coordinates and records that choice in asset.extras.kernelcad.units for consumers that read kernelCAD metadata; standard viewers still interpret raw coordinates as metres. style \"lowpoly\" writes a faceted, flat-shaded game asset with every opaque part coloured through COLOR_0 on one shared material \"kernelcad-palette\" (merges to one draw call); asset.extras.kernelcad carries stats { triangles, sizeM, minUpM, materials, drawCalls, parts, hasRig, hasIk } and palette zones; exceeding maxTriangles fails with export.glb.triangle-budget. asset-pack takes no extra keys: it zips the default-parameter GLB (named materials and mesh stats) with the script when the licence allows it, params JSON, a knob README, an SPDX licence, a three.js viewer and a sha256 manifest. obj: { tolerance?: mm (finite, >= 0.001), angularToleranceDeg?: degrees }; usd writes ASCII USDA (millimeter, Z-up). ply: { encoding?: \"binary\"|\"ascii\" (default \"binary\" = binary_little_endian), normals?: boolean (default true; vertices split at creases over 30°), colors?: \"vertex\"|\"face\"|\"none\" (default \"vertex\": uchar red/green/blue per vertex; \"face\" puts them on the face element) }; any other key or value fails with export.ply.invalid-options. svg-drawing: { views?: [\"front\"], sheet?: \"a4\"|\"a3\" (or any pdf-drawing sheet), layoutRepair?: boolean, projection?, titleBlock?: { title?, partName?, material?, revision? }, modelName?, date?, annotations?, exploded?: { factor, mode? }, balloons?, partsList?, sections?, autoAnnotate? }. Pass views:[\"front\"], [\"top\"], or [\"left\"] for one centred orthographic view in SVG or PDF; omit views for four views. Single-view sheets require annotations on the selected view and reject isometric balloons and exploded overlays. svg-drawing annotations is an array of authored dimensions/notes, each { kind: \"linear\"|\"radius\"|\"diameter\"|\"angular\"|\"note\", view?: \"front\"|\"top\"|\"left\"|\"iso\", text?, offset? } plus kind-specific geometry: linear { from, to }, radius/diameter { edge: EdgeQuery }, angular { from: EdgeQuery, to: EdgeQuery }, note { at, text }. from/to/at anchors are an [x,y,z] model point, { edge: EdgeQuery } or { face: FaceQuery }. Supplying any annotation REPLACES the automatic bounding-box dimensions; an annotation whose query resolves to zero or multiple matches fails the export rather than being dropped. svg-drawing sections is an array of { plane: \"xy\"|\"xz\"|\"yz\"|{ origin, normal }, label } (any non-zero normal). svg-drawing autoAnnotate is true or { tolerance?: \"ISO2768-f\"|\"ISO2768-m\"|\"ISO2768-c\", datums?: \"auto\"|[{ label, face: FaceQuery }], include?: [\"datums\"|\"flatness\"|\"holes\"|\"hole-positions\"|\"overall\"|\"fillets\"|\"chamfers\"|\"general-tolerance\"], dimensioningStyle?: \"baseline\"|\"chain\"|\"symmetry\" }; datums and tolerances declared in the script with shape.datum() / shape.tolerance() override the automatic ones. pdf-drawing: { sheet?: \"a4\"|\"a3\"|\"a2\"|\"a1\"|\"a0\"|\"ansi-a\"|\"ansi-b\"|\"ansi-c\"|\"ansi-d\"|\"ansi-e\"|\"auto\"|\"auto-ansi\" (default \"a3\"), projection?: \"third\"|\"first\", title?, partName?, material?, revision?, date? (default today), modelName?, views?: [\"front\"], annotations?, sections?, exploded?, balloons?, partsList?, autoAnnotate?, layoutRepair?: boolean (legacy sheet-only repair) } — the svg-drawing keys mean the same. Mechanical SVG/PDF also accept visualQa?: { autoRepair?: boolean, maxAttempts?: 1|2|3 }, the preferred end-to-end QA path. The drawing_report.visualQa covers actual SVG/PDF layout, critical requirements, verified PDF text and accepted/rejected repair attempts. A clean PDF drawing does not certify physical fit or tolerances. layoutRepair is retained for compatibility but must not be combined with visualQa. Mechanical SVG/PDF also accept draftingProfile?: \"general\"|\"machining\"|\"sheet-metal\" or { id, name, sheet, projection, dimensioningStyle, tolerance?, notes? }, with explicit options overriding profile defaults. Functional drawing review: shape.drawingReview(plan) source declarations merge with reviewPlans?: additional plans; decisionResolutions?: { [encodeURIComponent(planId)+\":\"+encodeURIComponent(decisionId)]: { note, provenance } }. drawing_report.review reports declared geometric-callout coverage and unresolved engineering decisions. requireCompleteReview?: true rejects incomplete/not-declared mechanical reviews before export; architectural style rejects review contracts. Coverage is not engineering certification. annotationOverrides?: { [drawing_report.annotations[i].id]: { suppress?, text?, view?, offset? } }; offset is extra nonnegative sheet mm. Text edits primary labels while preserving attached FCFs; datum/standalone FCF text is changed in its declaration instead. Suppressed rows remain in the report but not visible counts. Missing IDs warn after geometry edits. Authored annotations can set id for stable review identity. svg-drawing and pdf-drawing also take style?: \"mechanical\" (default, the part sheet) | \"architectural\" (a floor plan for a building or room model: section about 1 m above the floor with filled cut walls, wall / opening chain dimensions and overall sizes, room labels with net area, scale bar, north arrow; millimetres, or feet-inches when the model is in whole feet / inches) and plan?: { units?: \"metric\"|\"imperial\", cutHeight?: mm above the floor, rooms?: [{ name, at: [x, y] }], northDeg?: degrees clockwise from sheet up }. A building-sized model drawn in the default style gets a drawing.style.architectural-suggested warning."
},
"no_verify": {
"type": "boolean",
"default": false,
"description": "Skip the default STL/STEP validity and watertightness gates."
},
"feature_id": {
"type": "string",
"description": "target:'model' — optional FeatureId to export; defaults to last."
},
"output_dir": {
"type": "string",
"description": "target:'part' — destination directory (all-parts mode); files are <dir>/<part>.stl. Hosted server: only the file name is used; the file is written to a server-owned directory and returned as a download link."
},
"output_path": {
"type": "string",
"description": "Destination path (a directory for format 'bend-table'). target:'model' — the export file (required). target:'part' — single-part .stl path. Hosted server: only the file name is used; the file is written to a server-owned directory and returned as a download link."
},
"quality_gate": {
"enum": [
"warn",
"block",
"off"
],
"type": "string",
"default": "warn",
"description": "Geometry-quality gate for stl/step/3mf/obj/ply/gcode (both targets): 'warn' exports and reports geometryQuality + warn diagnostics, 'block' fails the export (nothing written) when tiny faces or short edges are found, 'off' skips it."
},
"tiny_face_area_mm2": {
"type": "number",
"minimum": 0,
"description": "Quality gate threshold: faces with BREP area below this (mm²) are tiny. Default 0.01; 0 disables."
},
"short_edge_length_mm": {
"type": "number",
"minimum": 0,
"description": "Quality gate threshold: edges shorter than this (mm) are short. Default 0.1; 0 disables."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Export",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}
}Use this when you need a canonical pattern snippet for a CAD task. Search the kernelCAD cookbook for canonical pattern snippets. Returns top-k snippets matching the natural-language query, ranked by BM25 over title/tags/keywords/trigger. Use when you need a canonical pattern for fillet-after-subtract, non-overlapping booleans, sketch-to-extrude flows, etc. Returns empty if no snippet scores above the relevance floor — proceed without cookbook help in that case. Lookup responses include `kernelSource`: the exact kernel package version/revision, composed runtime source hash, and version-pinned public authoring/API references.
| Parameter | Type | Description |
|---|---|---|
| k | number | Max snippets to return. Default 3, max 5. |
| id | string | Exact snippet id as the skills cite it (e.g. "clearance-hole-through-plate"); returns that snippet. An unknown id is ranked as a query. |
| query | string | Natural-language description of what you want to do (e.g. "round the rim of a hole", "build an L-bracket"). One of query / id is required. |
| intent | string | 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. |
{
"name": "lookup_cookbook",
"title": "Look Up Cookbook",
"description": "Use this when you need a canonical pattern snippet for a CAD task. Search the kernelCAD cookbook for canonical pattern snippets. Returns top-k snippets matching the natural-language query, ranked by BM25 over title/tags/keywords/trigger. Use when you need a canonical pattern for fillet-after-subtract, non-overlapping booleans, sketch-to-extrude flows, etc. Returns empty if no snippet scores above the relevance floor — proceed without cookbook help in that case. Lookup responses include `kernelSource`: the exact kernel package version/revision, composed runtime source hash, and version-pinned public authoring/API references.",
"inputSchema": {
"type": "object",
"properties": {
"k": {
"type": "number",
"default": 3,
"description": "Max snippets to return. Default 3, max 5."
},
"id": {
"type": "string",
"description": "Exact snippet id as the skills cite it (e.g. \"clearance-hole-through-plate\"); returns that snippet. An unknown id is ranked as a query."
},
"query": {
"type": "string",
"description": "Natural-language description of what you want to do (e.g. \"round the rim of a hole\", \"build an L-bracket\"). One of query / id is required."
},
"intent": {
"type": "string",
"maxLength": 2000,
"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."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Look Up Cookbook",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Search the bundled parts catalog (offline). For a NEMA-17 motor write `await lib.standard.nema17()`; for a 608 bearing write `await lib.standard.bearing608()`. For remote results, set source:"remote" to search the official KernelCAD catalog. Remote lookups fail within 45s with errorCode parts.lookup.timeout instead of hanging.
| Parameter | Type | Description |
|---|---|---|
| tag | string | |
| limit | number | |
| query | string | |
| family | string | |
| intent | string | 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. |
| source | string | one of ["local","remote","auto"] |
| category | string | |
| standard | string | |
| parts_base_url | string | Opt-in remote endpoint; no default value ships with kernelCAD. |
{
"name": "find_part",
"title": "Find Part",
"description": "Search the bundled parts catalog (offline). For a NEMA-17 motor write `await lib.standard.nema17()`; for a 608 bearing write `await lib.standard.bearing608()`. For remote results, set source:\"remote\" to search the official KernelCAD catalog. Remote lookups fail within 45s with errorCode parts.lookup.timeout instead of hanging.",
"inputSchema": {
"type": "object",
"properties": {
"tag": {
"type": "string"
},
"limit": {
"type": "number"
},
"query": {
"type": "string"
},
"family": {
"type": "string"
},
"intent": {
"type": "string",
"maxLength": 2000,
"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."
},
"source": {
"enum": [
"local",
"remote",
"auto"
],
"type": "string"
},
"category": {
"type": "string"
},
"standard": {
"type": "string"
},
"parts_base_url": {
"type": "string",
"description": "Opt-in remote endpoint; no default value ships with kernelCAD."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Find Part",
"readOnlyHint": true,
"openWorldHint": true,
"idempotentHint": true,
"destructiveHint": false
}
}Fetch one bundled catalog part. Prefer `await lib.standard.nema17()` and `await lib.standard.bearing608()` — they are offline and do not download remote STEP. A lookup that cannot finish fails within 45s with errorCode parts.lookup.timeout. Do not retry in parallel.
| Parameter | Type | Description |
|---|---|---|
| id | string | |
| model | object | Verified model options; supplying model implies include_model. |
| query | string | |
| family | string | |
| category | string | |
| standard | string | |
| include_model | boolean | Resolve a hash-verified STEP/GLB model file instead of the plain catalog STEP record. |
| parts_base_url | string | Opt-in remote endpoint; no default value ships with kernelCAD. |
{
"name": "fetch_part",
"title": "Fetch Part",
"description": "Fetch one bundled catalog part. Prefer `await lib.standard.nema17()` and `await lib.standard.bearing608()` — they are offline and do not download remote STEP. A lookup that cannot finish fails within 45s with errorCode parts.lookup.timeout. Do not retry in parallel.",
"inputSchema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"model": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "Direct public HTTPS .step/.stp/.glb download URL. Requires sha256, source and license."
},
"sha256": {
"type": "string",
"description": "Required SHA-256 digest for an explicit URL; for catalog parts it overrides the catalog GLB digest."
},
"source": {
"type": "string",
"description": "Catalog or manufacturer name, such as KiCad Packages3D."
},
"license": {
"type": "string",
"description": "License string supplied by the source."
},
"attribution": {
"type": "string"
},
"tolerance_ratio": {
"type": "number",
"description": "Relative expected-versus-measured bbox tolerance, default 0.25."
},
"expected_bbox_mm": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "Expected [x,y,z] dimensions to compare with the measured model."
}
},
"description": "Verified model options; supplying model implies include_model."
},
"query": {
"type": "string"
},
"family": {
"type": "string"
},
"category": {
"type": "string"
},
"standard": {
"type": "string"
},
"include_model": {
"type": "boolean",
"description": "Resolve a hash-verified STEP/GLB model file instead of the plain catalog STEP record."
},
"parts_base_url": {
"type": "string",
"description": "Opt-in remote endpoint; no default value ships with kernelCAD."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Fetch Part",
"readOnlyHint": true,
"openWorldHint": true,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to solve a 2D sketch constraint set. Solve a 2D sketch constraint set. Side-effect-free: pass { entities, constraints } and receive solved entities plus the original constraints. Entities are POINT, LINE, and CIRCLE records; constraints use the kernelCAD constraint vocabulary.
| Parameter | Type | Description |
|---|---|---|
| entities * | array | Sketch entities to solve. Lines reference point ids; circles reference a center point id. |
| constraints * | array | Constraints to apply to the entities. |
{
"name": "solve_sketch",
"title": "Solve Sketch",
"description": "Use this when you need to solve a 2D sketch constraint set. Solve a 2D sketch constraint set. Side-effect-free: pass { entities, constraints } and receive solved entities plus the original constraints. Entities are POINT, LINE, and CIRCLE records; constraints use the kernelCAD constraint vocabulary.",
"inputSchema": {
"type": "object",
"required": [
"entities",
"constraints"
],
"properties": {
"entities": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"required": [
"id",
"type",
"x",
"y"
],
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"id": {
"type": "string"
},
"type": {
"enum": [
"POINT"
],
"type": "string"
},
"fixed": {
"type": "boolean",
"description": "If true, the solver won't move this point."
}
},
"description": "POINT — a 2D point."
},
{
"type": "object",
"required": [
"id",
"type",
"p1",
"p2"
],
"properties": {
"id": {
"type": "string"
},
"p1": {
"type": "string"
},
"p2": {
"type": "string"
},
"type": {
"enum": [
"LINE"
],
"type": "string"
}
},
"description": "LINE — references two point ids."
},
{
"type": "object",
"required": [
"id",
"type",
"center",
"radius"
],
"properties": {
"id": {
"type": "string"
},
"type": {
"enum": [
"CIRCLE"
],
"type": "string"
},
"center": {
"type": "string"
},
"radius": {
"type": "number"
}
},
"description": "CIRCLE — references a center point id."
}
]
},
"description": "Sketch entities to solve. Lines reference point ids; circles reference a center point id."
},
"constraints": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"type",
"entities"
],
"properties": {
"id": {
"type": "string"
},
"type": {
"enum": [
"COINCIDENT",
"DISTANCE",
"HORIZONTAL",
"VERTICAL",
"PARALLEL",
"PERPENDICULAR",
"EQUAL_LENGTH",
"TANGENT",
"RADIUS",
"ANGLE",
"CONCENTRIC",
"SYMMETRIC"
],
"type": "string"
},
"value": {
"type": "number",
"description": "Required for DISTANCE, RADIUS, and ANGLE."
},
"entities": {
"type": "array",
"items": {
"type": "string"
},
"description": "Ids of the entities the constraint relates."
}
}
},
"description": "Constraints to apply to the entities."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Solve Sketch",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to add a sketch constraint to a list. Append one validated sketch constraint to a constraint list. Side-effect-free: pass { constraints, constraint } and receive the updated list.
| Parameter | Type | Description |
|---|---|---|
| constraint * | object | The constraint to append. |
| constraints | array | Existing constraint list to append to (omit for an empty list). |
{
"name": "add_constraint",
"title": "Add Constraint",
"description": "Use this when you need to add a sketch constraint to a list. Append one validated sketch constraint to a constraint list. Side-effect-free: pass { constraints, constraint } and receive the updated list.",
"inputSchema": {
"type": "object",
"required": [
"constraint"
],
"properties": {
"constraint": {
"type": "object",
"required": [
"id",
"type",
"entities"
],
"properties": {
"id": {
"type": "string"
},
"type": {
"enum": [
"COINCIDENT",
"DISTANCE",
"HORIZONTAL",
"VERTICAL",
"PARALLEL",
"PERPENDICULAR",
"EQUAL_LENGTH",
"TANGENT",
"RADIUS",
"ANGLE",
"CONCENTRIC",
"SYMMETRIC"
],
"type": "string"
},
"value": {
"type": "number",
"description": "Required for DISTANCE, RADIUS, and ANGLE."
},
"entities": {
"type": "array",
"items": {
"type": "string"
},
"description": "Ids of the entities the constraint relates."
}
},
"description": "The constraint to append."
},
"constraints": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"type",
"entities"
],
"properties": {
"id": {
"type": "string"
},
"type": {
"enum": [
"COINCIDENT",
"DISTANCE",
"HORIZONTAL",
"VERTICAL",
"PARALLEL",
"PERPENDICULAR",
"EQUAL_LENGTH",
"TANGENT",
"RADIUS",
"ANGLE",
"CONCENTRIC",
"SYMMETRIC"
],
"type": "string"
},
"value": {
"type": "number"
},
"entities": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"description": "Existing constraint list to append to (omit for an empty list)."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Add Constraint",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to add a part to an assembly. Durably insert `const <binding> = <assembly>.part(partName, shapeExpression, opts?)` before the final top-level return in a kernelCAD source string. Returns modified source plus diagnostics from re-evaluating it. Side-effect-free: caller persists the returned source.
| Parameter | Type | Description |
|---|---|---|
| at | array | Optional [x, y, z] assembly placement. |
| code * | string | The .kcad.ts source code. |
| part_name * | string | Assembly-unique part name. |
| binding_name | string | Optional JS const name for the returned AssemblyPartRef. Defaults to a part-name-derived identifier. |
| assembly_binding * | string | JS identifier bound to assembly(...), e.g. "arm". |
| shape_expression * | string | JS expression for the Shape to pass to assembly.part, inserted verbatim. |
{
"name": "add_part",
"title": "Add Part",
"description": "Use this when you need to add a part to an assembly. Durably insert `const <binding> = <assembly>.part(partName, shapeExpression, opts?)` before the final top-level return in a kernelCAD source string. Returns modified source plus diagnostics from re-evaluating it. Side-effect-free: caller persists the returned source.",
"inputSchema": {
"type": "object",
"required": [
"code",
"assembly_binding",
"part_name",
"shape_expression"
],
"properties": {
"at": {
"type": "array",
"items": {
"type": "number"
},
"description": "Optional [x, y, z] assembly placement."
},
"code": {
"type": "string",
"description": "The .kcad.ts source code."
},
"part_name": {
"type": "string",
"description": "Assembly-unique part name."
},
"binding_name": {
"type": "string",
"description": "Optional JS const name for the returned AssemblyPartRef. Defaults to a part-name-derived identifier."
},
"assembly_binding": {
"type": "string",
"description": "JS identifier bound to assembly(...), e.g. \"arm\"."
},
"shape_expression": {
"type": "string",
"description": "JS expression for the Shape to pass to assembly.part, inserted verbatim."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Add Part",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to add a mate connector to a part. Durably insert `<partBinding>.connector(name, { type, origin, axis?, normal? })` before the final top-level return. Use the part binding returned by add_part. Returns modified source plus diagnostics from re-evaluation. Side-effect-free.
| Parameter | Type | Description |
|---|---|---|
| axis | array | Optional [x, y, z] axis. |
| code * | string | The .kcad.ts source code. |
| name * | string | Connector name unique within the part. |
| type * | string | one of ["frame","axis","planar","ball"] |
| normal | array | Optional [x, y, z] normal. |
| origin * | any | Origin as [x, y, z] shorthand, or a structured ConnectorOrigin. |
| part_binding * | string | JS identifier bound to an AssemblyPartRef, e.g. "basePart". |
{
"name": "add_connector",
"title": "Add Connector",
"description": "Use this when you need to add a mate connector to a part. Durably insert `<partBinding>.connector(name, { type, origin, axis?, normal? })` before the final top-level return. Use the part binding returned by add_part. Returns modified source plus diagnostics from re-evaluation. Side-effect-free.",
"inputSchema": {
"type": "object",
"required": [
"code",
"part_binding",
"name",
"type",
"origin"
],
"properties": {
"axis": {
"type": "array",
"items": {
"type": "number"
},
"description": "Optional [x, y, z] axis."
},
"code": {
"type": "string",
"description": "The .kcad.ts source code."
},
"name": {
"type": "string",
"description": "Connector name unique within the part."
},
"type": {
"enum": [
"frame",
"axis",
"planar",
"ball"
],
"type": "string"
},
"normal": {
"type": "array",
"items": {
"type": "number"
},
"description": "Optional [x, y, z] normal."
},
"origin": {
"oneOf": [
{
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "[x, y, z] shorthand."
},
{
"type": "object",
"required": [
"kind",
"value"
],
"properties": {
"kind": {
"enum": [
"vec3"
],
"type": "string"
},
"value": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
}
},
"description": "Explicit numeric origin."
},
{
"type": "object",
"required": [
"kind",
"query"
],
"properties": {
"kind": {
"enum": [
"topology"
],
"type": "string"
},
"query": {
"type": "object",
"required": [
"kind",
"name"
],
"properties": {
"kind": {
"enum": [
"face-center",
"face-normal",
"vertex",
"edge-axis",
"hole-axis"
],
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"description": "Topology-derived origin."
}
],
"description": "Origin as [x, y, z] shorthand, or a structured ConnectorOrigin."
},
"part_binding": {
"type": "string",
"description": "JS identifier bound to an AssemblyPartRef, e.g. \"basePart\"."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Add Connector",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to author a mate-graph relationship into the source, selected by `relation` (default 'mate'): - 'mate' — a typed mate between two connectors ({ name, a, b, type, pose?, limits_deg?, limits_mm? }). - 'coupling' — couple a driven mate to a source mate by ratio ({ driven, source, ratio, offset? }). - 'transmission' — a physical drive path across mates ({ name, kind, source_mate, driven_mates, path, ... }). All durably edit source and need { code, assembly_binding }. The inserted script keeps `limitsDeg`, `limitsMm`, `sourceMate`, and `drivenMates`; pass `limits_deg`, `limits_mm`, `source_mate`, and `driven_mates`. Each relation fails closed on its own missing required params.
| Parameter | Type | Description |
|---|---|---|
| a | string | relation:'mate' — connector ref "<partName>.<connectorName>". |
| b | string | relation:'mate' — connector ref "<partName>.<connectorName>". |
| code * | string | The .kcad.ts source code. |
| kind | string | relation:'transmission' — transmission kind. |
| name | string | relation:'mate'|'transmission' — name unique within the assembly. |
| path | array | relation:'transmission' — drive path. |
| pose | object | relation:'mate' — optional mate pose. |
| type | string | relation:'mate' — mate type. |
| input | string | relation:'transmission' — optional input. |
| notes | string | relation:'transmission' — optional notes. |
| ratio | number | relation:'coupling' — driven pose = source pose * ratio + offset. |
| driven | string | relation:'coupling' — driven mate name. |
| offset | number | relation:'coupling' — optional pose offset. |
| output | string | relation:'transmission' — optional output. |
| source | string | relation:'coupling' — source mate name. |
| actuator | string | relation:'transmission' — optional actuator. |
| adhesive | object | Optional planar adhesive interface for a fastened mate. Select one canonical face on each part. |
| relation | string | Which relationship to author (default 'mate'). |
| limits_mm | array | relation:'mate' — optional [minMm, maxMm]. |
| limits_deg | array | relation:'mate' — optional [minDeg, maxDeg]. |
| source_mate | string | relation:'transmission' — source mate name. |
| driven_mates | array | relation:'transmission' — driven mate names. |
| assembly_binding * | string | JS identifier bound to assembly(...). |
{
"name": "add_mate",
"title": "Add Mate",
"description": "Use this when you need to author a mate-graph relationship into the source, selected by `relation` (default 'mate'):\n- 'mate' — a typed mate between two connectors ({ name, a, b, type, pose?, limits_deg?, limits_mm? }).\n- 'coupling' — couple a driven mate to a source mate by ratio ({ driven, source, ratio, offset? }).\n- 'transmission' — a physical drive path across mates ({ name, kind, source_mate, driven_mates, path, ... }).\nAll durably edit source and need { code, assembly_binding }. The inserted script keeps `limitsDeg`, `limitsMm`, `sourceMate`, and `drivenMates`; pass `limits_deg`, `limits_mm`, `source_mate`, and `driven_mates`. Each relation fails closed on its own missing required params.",
"inputSchema": {
"type": "object",
"allOf": [
{
"if": {
"anyOf": [
{
"not": {
"required": [
"relation"
]
}
},
{
"required": [
"relation"
],
"properties": {
"relation": {
"const": "mate"
}
}
}
]
},
"then": {
"required": [
"name",
"a",
"b",
"type"
]
}
},
{
"if": {
"required": [
"relation"
],
"properties": {
"relation": {
"const": "coupling"
}
}
},
"then": {
"required": [
"driven",
"source",
"ratio"
]
}
},
{
"if": {
"required": [
"relation"
],
"properties": {
"relation": {
"const": "transmission"
}
}
},
"then": {
"required": [
"name",
"kind",
"sourceMate",
"drivenMates",
"path"
]
}
}
],
"required": [
"code",
"assembly_binding"
],
"properties": {
"a": {
"type": "string",
"description": "relation:'mate' — connector ref \"<partName>.<connectorName>\"."
},
"b": {
"type": "string",
"description": "relation:'mate' — connector ref \"<partName>.<connectorName>\"."
},
"code": {
"type": "string",
"description": "The .kcad.ts source code."
},
"kind": {
"enum": [
"direct",
"link-rod",
"four-bar",
"gear-pair",
"belt",
"tendon"
],
"type": "string",
"description": "relation:'transmission' — transmission kind."
},
"name": {
"type": "string",
"description": "relation:'mate'|'transmission' — name unique within the assembly."
},
"path": {
"type": "array",
"items": {
"type": "string"
},
"description": "relation:'transmission' — drive path."
},
"pose": {
"type": "object",
"description": "relation:'mate' — optional mate pose."
},
"type": {
"enum": [
"fastened",
"revolute",
"prismatic",
"cylindrical",
"planar",
"ball",
"pin_slot"
],
"type": "string",
"description": "relation:'mate' — mate type."
},
"input": {
"type": "string",
"description": "relation:'transmission' — optional input."
},
"notes": {
"type": "string",
"description": "relation:'transmission' — optional notes."
},
"ratio": {
"type": "number",
"description": "relation:'coupling' — driven pose = source pose * ratio + offset."
},
"driven": {
"type": "string",
"description": "relation:'coupling' — driven mate name."
},
"offset": {
"type": "number",
"description": "relation:'coupling' — optional pose offset."
},
"output": {
"type": "string",
"description": "relation:'transmission' — optional output."
},
"source": {
"type": "string",
"description": "relation:'coupling' — source mate name."
},
"actuator": {
"type": "string",
"description": "relation:'transmission' — optional actuator."
},
"adhesive": {
"type": "object",
"required": [
"face_a",
"face_b"
],
"properties": {
"face_a": {
"enum": [
"left",
"right",
"front",
"back",
"top",
"bottom"
],
"type": "string"
},
"face_b": {
"enum": [
"left",
"right",
"front",
"back",
"top",
"bottom"
],
"type": "string"
}
},
"description": "Optional planar adhesive interface for a fastened mate. Select one canonical face on each part."
},
"relation": {
"enum": [
"mate",
"coupling",
"transmission"
],
"type": "string",
"description": "Which relationship to author (default 'mate')."
},
"limits_mm": {
"type": "array",
"items": {
"type": "number"
},
"description": "relation:'mate' — optional [minMm, maxMm]."
},
"limits_deg": {
"type": "array",
"items": {
"type": "number"
},
"description": "relation:'mate' — optional [minDeg, maxDeg]."
},
"source_mate": {
"type": "string",
"description": "relation:'transmission' — source mate name."
},
"driven_mates": {
"type": "array",
"items": {
"type": "string"
},
"description": "relation:'transmission' — driven mate names."
},
"assembly_binding": {
"type": "string",
"description": "JS identifier bound to assembly(...)."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Add Mate",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to declare a reachability target for a connector. Durably insert `<assembly>.workspace(connectorRef, { reachable, toleranceMm? })` before the final top-level return. Pass `tolerance_mm` for that script option. Workspace targets are checked by solvedModel validation/review pose-envelope gates. Returns modified source plus diagnostics from re-evaluation.
| Parameter | Type | Description |
|---|---|---|
| code * | string | The .kcad.ts source code. |
| reachable * | array | World-frame Vec3 targets the connector must be able to reach. |
| tolerance_mm | number | Optional non-negative tolerance in mm. |
| connector_ref * | string | Connector ref "<partName>.<connectorName>". |
| assembly_binding * | string | JS identifier bound to assembly(...). |
{
"name": "add_workspace_target",
"title": "Add Workspace Target",
"description": "Use this when you need to declare a reachability target for a connector. Durably insert `<assembly>.workspace(connectorRef, { reachable, toleranceMm? })` before the final top-level return. Pass `tolerance_mm` for that script option. Workspace targets are checked by solvedModel validation/review pose-envelope gates. Returns modified source plus diagnostics from re-evaluation.",
"inputSchema": {
"type": "object",
"required": [
"code",
"assembly_binding",
"connector_ref",
"reachable"
],
"properties": {
"code": {
"type": "string",
"description": "The .kcad.ts source code."
},
"reachable": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
},
"description": "World-frame Vec3 targets the connector must be able to reach."
},
"tolerance_mm": {
"type": "number",
"description": "Optional non-negative tolerance in mm."
},
"connector_ref": {
"type": "string",
"description": "Connector ref \"<partName>.<connectorName>\"."
},
"assembly_binding": {
"type": "string",
"description": "JS identifier bound to assembly(...)."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Add Workspace Target",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to set how the script returns its assembly. Replace the final top-level return statement with `return <assembly>.model();` or `return <assembly>.solvedModel(poses, options?);`. Use solvedModel for mate-authored mechanisms so FK and validation run. Returns modified source plus diagnostics from re-evaluation.
| Parameter | Type | Description |
|---|---|---|
| code * | string | The .kcad.ts source code. |
| mode * | string | one of ["model","solvedModel"] |
| poses | object | Optional solvedModel pose overrides keyed by mate name. Defaults to {}. |
| options | object | Optional solvedModel options such as { validate: 'warn', posesGate: 'envelope' }. |
| assembly_binding * | string | JS identifier bound to assembly(...). |
{
"name": "set_scene_return",
"title": "Set Scene Return",
"description": "Use this when you need to set how the script returns its assembly. Replace the final top-level return statement with `return <assembly>.model();` or `return <assembly>.solvedModel(poses, options?);`. Use solvedModel for mate-authored mechanisms so FK and validation run. Returns modified source plus diagnostics from re-evaluation.",
"inputSchema": {
"type": "object",
"required": [
"code",
"assembly_binding",
"mode"
],
"properties": {
"code": {
"type": "string",
"description": "The .kcad.ts source code."
},
"mode": {
"enum": [
"model",
"solvedModel"
],
"type": "string"
},
"poses": {
"type": "object",
"description": "Optional solvedModel pose overrides keyed by mate name. Defaults to {}."
},
"options": {
"type": "object",
"description": "Optional solvedModel options such as { validate: 'warn', posesGate: 'envelope' }."
},
"assembly_binding": {
"type": "string",
"description": "JS identifier bound to assembly(...)."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Set Scene Return",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Solve the mate graph and get part poses. Pass code/file for an atomic source-bound solve, or omit both to use the active assembly. Returns { ok, status, poses, iterations?, evaluationEvidence? } where each pose is a serialized Transform ({ translation, rotateAxis, rotateDeg }). Optional `poses` overrides are keyed by mate name and accept only solver-supported pose coordinates. Fastened mates have zero articulation DOFs and planar mates have no supported pose coordinate; overrides for either return `feature.invalid-args`. Supplied source is captured once, consumed within this call and released after solving.
| Parameter | Type | Description |
|---|---|---|
| code | string | Inline kernelCAD source to capture and solve in this call. |
| file | string | Path to a kernelCAD script to capture and solve in this call. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| poses | object | Optional numeric overrides keyed by mate name. Only mate types with solver-supported pose coordinates accept overrides; fastened mates have zero articulation DOFs and planar mates have no supported pose coordinate, so overrides for either return `feature.invalid-args`. |
| assembly | string |
{
"name": "solve_mates",
"title": "Solve Mates",
"description": "Solve the mate graph and get part poses. Pass code/file for an atomic source-bound solve, or omit both to use the active assembly. Returns { ok, status, poses, iterations?, evaluationEvidence? } where each pose is a serialized Transform ({ translation, rotateAxis, rotateDeg }). Optional `poses` overrides are keyed by mate name and accept only solver-supported pose coordinates. Fastened mates have zero articulation DOFs and planar mates have no supported pose coordinate; overrides for either return `feature.invalid-args`. Supplied source is captured once, consumed within this call and released after solving.",
"inputSchema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Inline kernelCAD source to capture and solve in this call."
},
"file": {
"type": "string",
"description": "Path to a kernelCAD script to capture and solve in this call. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"poses": {
"type": "object",
"description": "Optional numeric overrides keyed by mate name. Only mate types with solver-supported pose coordinates accept overrides; fastened mates have zero articulation DOFs and planar mates have no supported pose coordinate, so overrides for either return `feature.invalid-args`."
},
"assembly": {
"type": "string"
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Solve Mates",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Run a deterministic mechanism-fitness review on supplied kernelCAD code or a file. It performs a full evaluation, replaces the active MCP session model on success, and clears that session if evaluation fails. The script may load referenced assets. The review validates the assembly/mate graph and connector placement, samples declared mate limits, optionally checks interference at sampled poses, and reports connector workspace bounds, fitness findings, and a repair mode (none, local-fix, parameter-tune, or topology-redesign). Runs within time_budget_ms (default 90 s); stages that do not fit are listed in skippedStages and were not checked. Hosted: lib.fromSTEP / fromSTL / meshFromSTL / fromDXF / fromSVG and referenceImage take a direct string literal or a const bound to one (computed expressions are unsupported). They accept "asset:<id>" (from request_upload), an https:// URL or a data: URI as the path.
| Parameter | Type | Description |
|---|---|---|
| code | string | Inline kernelCAD script source. |
| file | string | Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| assembly | string | Assembly name; defaults to the first captured assembly. |
| design_goal | string | Original user design prompt or goal. Included in suggestedRepairPrompt so topology-redesign repairs restart from the intended physical design instead of local coordinate nudges. |
| epsilon_mm3 | number | Interference volume threshold in mm^3. Default 0.01. |
| combinatorial | boolean | Sample all 2^N limit-corner combinations across mates with declared limits. Capped at 8 mates with limits; combine with samples_per_mate for both interior coverage and worst-pose detection. Default false. |
| time_budget_ms | number | Wall-clock budget for the review in ms (default 90000). Once spent, the remaining heavy stages (pose envelope, physical use case, mechanism sweep) are skipped and listed in skippedStages — a partial result instead of a timeout. stageTimingsMs reports where the time went. |
| samples_per_mate | integer | Pose-envelope samples per declared-limit mate. 1 (default) = corners only; >=3 adds uniform interior points between min and max. Total samples per non-locked mate = samples_per_mate. |
| track_connectors | array | Optional connector refs such as ["gripper-plate.tool-tip"] to limit connector workspace reporting. |
| preserve_interfaces | array | External mates, connector refs, part names, or behavioral interfaces the repair agent must preserve during redesign. |
| include_interference | boolean | Whether sampled poses run BREP interference checks. Default true. |
| mechanismSweepBudget | integer | Maximum estimated BREP work for mechanism limit sweeps and DOF probes. If omitted, the hosted default is 80000 on a ready sandbox with the attested bounded-16g-v1 capacity profile; otherwise it is 40000. Explicit values are preserved. Existing sampling, tolerances and job time/memory limits apply. d… |
| include_pose_envelope | boolean | Whether to sample declared mate limits. Default true. |
| mechanism_sweep_budget | integer | Maximum estimated BREP work for the mechanism limit sweep and DOF probes. Default 40000. Existing sampling, tolerances and job time/memory guards apply. design_loop forwards this budget to every attempt. |
| physical_use_case_level | string | Escalating physical-use-case depth; each level includes the previous. 'reachability': targeted sampling over scalar-limited mates named in actuatorLimits, rejecting contacts that cannot get within criteria.maxSlipMm and multi-contact use cases that cannot satisfy every contact in the same sampled ac… |
| require_physical_use_case | boolean | When true, articulated assemblies must declare arm.physicalUseCase(...) evidence: loads, contacts, stable parts, and actuator limits. |
| physical_use_case_samples_per_mate | integer | Samples per scalar-limited actuator mate for physical-use-case contact reachability. Samples revolute/cylindrical/pin-slot limitsDeg and prismatic limitsMm. Default 3; total targeted combinations are capped. |
{
"name": "review_cad",
"title": "Review CAD Model",
"description": "Run a deterministic mechanism-fitness review on supplied kernelCAD code or a file. It performs a full evaluation, replaces the active MCP session model on success, and clears that session if evaluation fails. The script may load referenced assets. The review validates the assembly/mate graph and connector placement, samples declared mate limits, optionally checks interference at sampled poses, and reports connector workspace bounds, fitness findings, and a repair mode (none, local-fix, parameter-tune, or topology-redesign). Runs within time_budget_ms (default 90 s); stages that do not fit are listed in skippedStages and were not checked. Hosted: lib.fromSTEP / fromSTL / meshFromSTL / fromDXF / fromSVG and referenceImage take a direct string literal or a const bound to one (computed expressions are unsupported). They accept \"asset:<id>\" (from request_upload), an https:// URL or a data: URI as the path.",
"inputSchema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Inline kernelCAD script source."
},
"file": {
"type": "string",
"description": "Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"assembly": {
"type": "string",
"description": "Assembly name; defaults to the first captured assembly."
},
"design_goal": {
"type": "string",
"description": "Original user design prompt or goal. Included in suggestedRepairPrompt so topology-redesign repairs restart from the intended physical design instead of local coordinate nudges."
},
"epsilon_mm3": {
"type": "number",
"description": "Interference volume threshold in mm^3. Default 0.01."
},
"combinatorial": {
"type": "boolean",
"description": "Sample all 2^N limit-corner combinations across mates with declared limits. Capped at 8 mates with limits; combine with samples_per_mate for both interior coverage and worst-pose detection. Default false."
},
"time_budget_ms": {
"type": "number",
"description": "Wall-clock budget for the review in ms (default 90000). Once spent, the remaining heavy stages (pose envelope, physical use case, mechanism sweep) are skipped and listed in skippedStages — a partial result instead of a timeout. stageTimingsMs reports where the time went."
},
"samples_per_mate": {
"type": "integer",
"minimum": 1,
"description": "Pose-envelope samples per declared-limit mate. 1 (default) = corners only; >=3 adds uniform interior points between min and max. Total samples per non-locked mate = samples_per_mate."
},
"track_connectors": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional connector refs such as [\"gripper-plate.tool-tip\"] to limit connector workspace reporting."
},
"preserve_interfaces": {
"type": "array",
"items": {
"type": "string"
},
"description": "External mates, connector refs, part names, or behavioral interfaces the repair agent must preserve during redesign."
},
"include_interference": {
"type": "boolean",
"description": "Whether sampled poses run BREP interference checks. Default true."
},
"mechanismSweepBudget": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": 1,
"description": "Maximum estimated BREP work for mechanism limit sweeps and DOF probes. If omitted, the hosted default is 80000 on a ready sandbox with the attested bounded-16g-v1 capacity profile; otherwise it is 40000. Explicit values are preserved. Existing sampling, tolerances and job time/memory limits apply. design_loop forwards this budget to every attempt."
},
"include_pose_envelope": {
"type": "boolean",
"description": "Whether to sample declared mate limits. Default true."
},
"mechanism_sweep_budget": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": 1,
"description": "Maximum estimated BREP work for the mechanism limit sweep and DOF probes. Default 40000. Existing sampling, tolerances and job time/memory guards apply. design_loop forwards this budget to every attempt."
},
"physical_use_case_level": {
"enum": [
"reachability",
"statics",
"reactions"
],
"type": "string",
"description": "Escalating physical-use-case depth; each level includes the previous. 'reachability': targeted sampling over scalar-limited mates named in actuatorLimits, rejecting contacts that cannot get within criteria.maxSlipMm and multi-contact use cases that cannot satisfy every contact in the same sampled actuator pose (revolute/cylindrical/pin-slot limitsDeg, prismatic limitsMm). 'statics': adds pose-bound quasi-static certification at the exact common-contact samples (conservative friction/capacity, world force and moment balance, finite-difference revolute actuator torque); returns physicalUseCaseStaticCertificates on success. 'reactions': adds exact-pose reaction wrenches through uniquely rooted articulated trees, compared against each loaded mate's declared resultant force/moment envelope, and runs the clevis double-shear / pin-bending / bearing / tear-out / net-section check (minimum factor of safety 2) automatically for mates built with joint.clevis. Defaults to 'reachability' when require_physical_use_case is true."
},
"require_physical_use_case": {
"type": "boolean",
"description": "When true, articulated assemblies must declare arm.physicalUseCase(...) evidence: loads, contacts, stable parts, and actuator limits."
},
"physical_use_case_samples_per_mate": {
"type": "integer",
"minimum": 1,
"description": "Samples per scalar-limited actuator mate for physical-use-case contact reachability. Samples revolute/cylindrical/pin-slot limitsDeg and prismatic limitsMm. Default 3; total targeted combinations are capped."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Review CAD Model",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}
}Use this when the goal is complex / production / enclosure / gearbox / robot-arm / multi-body, or when you need evaluate→review/verify→revise until green. PREFERRED over one-shot evaluate_script+open_in_studio for Adam-level parts. Runs a CAD design loop over attempt scripts: review_cad each attempt, continue past functional attempts with unresolved warnings, return repair prompts (nextActionPrompt) plus structured revisionAssist (suggestedPatches / autoApplied.suggestedCode for repairable feature failures; cookbook steers for stacked-primitive toys). Stop on ok or convergence.escalate. To pick among N alternative candidates for one goal without a judge, pass them all as attempts with consensus:true (geometric medoid selection). Optionally write a Studio build record JSON.
| Parameter | Type | Description |
|---|---|---|
| goal * | string | Original user design goal. Fed into every review_cad repair prompt. |
| assembly | string | |
| attempts * | array | Ordered design attempts. Each item is { id?, title?, file? OR code?, visualReview? } — provide file or code (at least one). File attempts can be replayed by Studio build records. |
| consensus | boolean | Best-of-N by geometric consensus. When true, attempts are N independent candidates for the SAME goal (not a repair sequence): all are reviewed (stop_on_pass ignored), all scripts are executed, candidates without a valid solid are dropped, and the candidate whose geometry agrees most with the others … |
| auto_revise | boolean | When true (default), failing attempts with repairable feature diagnostics (boolean miss, oversized fillet, …) run bounded repair_script and attach revisionAssist.suggestedPatches / autoApplied.suggestedCode. Set false to skip the extra repair pass (hints-only). Does not autonomously rewrite full CAD… |
| epsilon_mm3 | number | Forwarded to review_cad. |
| record_title | string | Optional title for the build record. |
| requirements | array | Call-time external requirements ([{ name, predicate }]) every attempt is graded against, in the same ledger as script require(). Predicate shape: { metric, a?, b?, op, limit, tolerance?, density? }; operands: { kind: body | faces | edges | part, ref, query? }. A failing or not-evaluated requirement … |
| stop_on_pass | boolean | Stop after the first attempt that is functional and passes the quality gate. Default true. |
| combinatorial | boolean | Sample all 2^N limit-corner combinations across mates with declared limits. Capped at 8 mates with limits; combine with samples_per_mate for both interior coverage and worst-pose detection. Default false. |
| samples_per_mate | integer | Pose-envelope samples per declared-limit mate. 1 (default) = corners only; >=3 adds uniform interior points between min and max. Total samples per non-locked mate = samples_per_mate. |
| track_connectors | array | Connector refs to track across sampled poses. |
| output_record_path | string | Optional JSON path to write a Studio-compatible build record. |
| preserve_interfaces | array | External mates, connector refs, part names, or behavioral interfaces the agent must preserve between attempts. |
| include_interference | boolean | Forwarded to review_cad. Default true. |
| mechanismSweepBudget | integer | Maximum estimated BREP work for mechanism limit sweeps and DOF probes. If omitted, the hosted default is 80000 on a ready sandbox with the attested bounded-16g-v1 capacity profile; otherwise it is 40000. Explicit values are preserved. Existing sampling, tolerances and job time/memory limits apply. d… |
| allow_review_warnings | array | Warning diagnostic codes the original prompt explicitly allows. Other review warnings keep the loop iterating even if review_cad is functionally ok. |
| include_pose_envelope | boolean | Forwarded to review_cad. Default true. |
| require_visual_review | boolean | Require screenshot-backed visual_review with structured checks before accepting an attempt. Default true; set false only for explicit non-visual batch checks. |
| mechanism_sweep_budget | integer | Maximum estimated BREP work for the mechanism limit sweep and DOF probes. Default 40000. Existing sampling, tolerances and job time/memory guards apply. design_loop forwards this budget to every attempt. |
| require_physical_acceptance | boolean | Require declared physicalUseCase common-pose reachability and pose-bound quasi-static certification before accepting an attempt. Design-loop also enables this automatically when an attempt script calls physicalUseCase(...). |
{
"name": "design_loop",
"title": "Run Design Loop",
"description": "Use this when the goal is complex / production / enclosure / gearbox / robot-arm / multi-body, or when you need evaluate→review/verify→revise until green. PREFERRED over one-shot evaluate_script+open_in_studio for Adam-level parts. Runs a CAD design loop over attempt scripts: review_cad each attempt, continue past functional attempts with unresolved warnings, return repair prompts (nextActionPrompt) plus structured revisionAssist (suggestedPatches / autoApplied.suggestedCode for repairable feature failures; cookbook steers for stacked-primitive toys). Stop on ok or convergence.escalate. To pick among N alternative candidates for one goal without a judge, pass them all as attempts with consensus:true (geometric medoid selection). Optionally write a Studio build record JSON.",
"inputSchema": {
"type": "object",
"required": [
"goal",
"attempts"
],
"properties": {
"goal": {
"type": "string",
"description": "Original user design goal. Fed into every review_cad repair prompt."
},
"assembly": {
"type": "string"
},
"attempts": {
"type": "array",
"items": {
"type": "object",
"anyOf": [
{
"required": [
"file"
]
},
{
"required": [
"code"
]
}
],
"properties": {
"id": {
"type": "string"
},
"code": {
"type": "string",
"description": "Inline kernelCAD script source. Provide file or code."
},
"file": {
"type": "string",
"description": "Path to a .kcad.ts script on disk. Provide file or code."
},
"title": {
"type": "string"
},
"visualReview": {
"type": "object",
"required": [
"accepted",
"findings"
],
"properties": {
"checks": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"passed",
"finding"
],
"properties": {
"code": {
"type": "string"
},
"passed": {
"type": "boolean"
},
"finding": {
"type": "string"
},
"screenshotPath": {
"type": "string"
}
}
},
"description": "Required checklist entries: main-object-count, proportions-match-reference, required-visible-features, no-stray-or-floating-geometry, attachment-plausibility, semantic-orientation-alignment, device-depth-and-construction, canonical-views-physically-coherent."
},
"accepted": {
"type": "boolean"
},
"findings": {
"type": "array",
"items": {
"type": "string"
}
},
"screenshotPath": {
"type": "string"
}
},
"description": "Optional. Evidence from the reviewing agent after rendering/opening screenshots. Accepted reviews must include screenshotPath, concrete findings, and all required checks passing."
}
}
},
"description": "Ordered design attempts. Each item is { id?, title?, file? OR code?, visualReview? } — provide file or code (at least one). File attempts can be replayed by Studio build records."
},
"consensus": {
"type": "boolean",
"description": "Best-of-N by geometric consensus. When true, attempts are N independent candidates for the SAME goal (not a repair sequence): all are reviewed (stop_on_pass ignored), all scripts are executed, candidates without a valid solid are dropped, and the candidate whose geometry agrees most with the others (medoid by symmetric Chamfer distance, same model frame) is selected. Ties go to more gates passed, then the shorter script. Returns consensus { chosenIndex, chosenAttemptId, scores, distances, reason }; ok / finalAttemptId / nextActionPrompt describe the selected candidate. Default false."
},
"auto_revise": {
"type": "boolean",
"description": "When true (default), failing attempts with repairable feature diagnostics (boolean miss, oversized fillet, …) run bounded repair_script and attach revisionAssist.suggestedPatches / autoApplied.suggestedCode. Set false to skip the extra repair pass (hints-only). Does not autonomously rewrite full CAD models."
},
"epsilon_mm3": {
"type": "number",
"description": "Forwarded to review_cad."
},
"record_title": {
"type": "string",
"description": "Optional title for the build record."
},
"requirements": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"description": "Call-time external requirements ([{ name, predicate }]) every attempt is graded against, in the same ledger as script require(). Predicate shape: { metric, a?, b?, op, limit, tolerance?, density? }; operands: { kind: body | faces | edges | part, ref, query? }. A failing or not-evaluated requirement blocks the attempt even with no expert geometry."
},
"stop_on_pass": {
"type": "boolean",
"description": "Stop after the first attempt that is functional and passes the quality gate. Default true."
},
"combinatorial": {
"type": "boolean",
"description": "Sample all 2^N limit-corner combinations across mates with declared limits. Capped at 8 mates with limits; combine with samples_per_mate for both interior coverage and worst-pose detection. Default false."
},
"samples_per_mate": {
"type": "integer",
"minimum": 1,
"description": "Pose-envelope samples per declared-limit mate. 1 (default) = corners only; >=3 adds uniform interior points between min and max. Total samples per non-locked mate = samples_per_mate."
},
"track_connectors": {
"type": "array",
"items": {
"type": "string"
},
"description": "Connector refs to track across sampled poses."
},
"output_record_path": {
"type": "string",
"description": "Optional JSON path to write a Studio-compatible build record."
},
"preserve_interfaces": {
"type": "array",
"items": {
"type": "string"
},
"description": "External mates, connector refs, part names, or behavioral interfaces the agent must preserve between attempts."
},
"include_interference": {
"type": "boolean",
"description": "Forwarded to review_cad. Default true."
},
"mechanismSweepBudget": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": 1,
"description": "Maximum estimated BREP work for mechanism limit sweeps and DOF probes. If omitted, the hosted default is 80000 on a ready sandbox with the attested bounded-16g-v1 capacity profile; otherwise it is 40000. Explicit values are preserved. Existing sampling, tolerances and job time/memory limits apply. design_loop forwards this budget to every attempt."
},
"allow_review_warnings": {
"type": "array",
"items": {
"type": "string"
},
"description": "Warning diagnostic codes the original prompt explicitly allows. Other review warnings keep the loop iterating even if review_cad is functionally ok."
},
"include_pose_envelope": {
"type": "boolean",
"description": "Forwarded to review_cad. Default true."
},
"require_visual_review": {
"type": "boolean",
"description": "Require screenshot-backed visual_review with structured checks before accepting an attempt. Default true; set false only for explicit non-visual batch checks."
},
"mechanism_sweep_budget": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": 1,
"description": "Maximum estimated BREP work for the mechanism limit sweep and DOF probes. Default 40000. Existing sampling, tolerances and job time/memory guards apply. design_loop forwards this budget to every attempt."
},
"require_physical_acceptance": {
"type": "boolean",
"description": "Require declared physicalUseCase common-pose reachability and pose-bound quasi-static certification before accepting an attempt. Design-loop also enables this automatically when an attempt script calls physicalUseCase(...)."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Run Design Loop",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need the unfolded flat pattern of a bent sheet-metal part. Return the unfolded 2D flat-pattern of a bent sheet-metal Shape as a Region (outer polyline + holes + bend lines + sketch plane). Any number of parallel bends; crossing bends need corner relief. Pass { file } or { code }; optional { feature_id } to pick a specific Shape.
| Parameter | Type | Description |
|---|---|---|
| code | string | |
| file | string | Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| feature_id | string |
{
"name": "flatten_pattern",
"title": "Flatten Sheet-Metal Pattern",
"description": "Use this when you need the unfolded flat pattern of a bent sheet-metal part. Return the unfolded 2D flat-pattern of a bent sheet-metal Shape as a Region (outer polyline + holes + bend lines + sketch plane). Any number of parallel bends; crossing bends need corner relief. Pass { file } or { code }; optional { feature_id } to pick a specific Shape.",
"inputSchema": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"file": {
"type": "string",
"description": "Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"feature_id": {
"type": "string"
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Flatten Sheet-Metal Pattern",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to sample a signed-distance field at a point. Sample the signed distance from an in-script sdf.* field at a 3D point. Returns { distance, inside, aabb, kind }. Distance is in mm; negative = inside the surface, 0 = exactly on the surface, positive = outside. Use this to verify SDF composition before calling sdf.materialize (which is the expensive step). The script must bind the SdfField via sdf.bind('<name>', field) and pass that name as field_name. Hint: pass either { file } or { code }, plus { field_name, point: [x,y,z] }.
| Parameter | Type | Description |
|---|---|---|
| code | string | Inline kernelCAD script source. |
| file | string | Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| point * | array | Sample point [x, y, z] in mm. |
| field_name * | string | sdf.bind binding name holding the SdfField. |
{
"name": "evaluate_sdf",
"title": "Evaluate SDF",
"description": "Use this when you need to sample a signed-distance field at a point. Sample the signed distance from an in-script sdf.* field at a 3D point. Returns { distance, inside, aabb, kind }. Distance is in mm; negative = inside the surface, 0 = exactly on the surface, positive = outside. Use this to verify SDF composition before calling sdf.materialize (which is the expensive step). The script must bind the SdfField via sdf.bind('<name>', field) and pass that name as field_name. Hint: pass either { file } or { code }, plus { field_name, point: [x,y,z] }.",
"inputSchema": {
"type": "object",
"required": [
"field_name",
"point"
],
"properties": {
"code": {
"type": "string",
"description": "Inline kernelCAD script source."
},
"file": {
"type": "string",
"description": "Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"point": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "Sample point [x, y, z] in mm."
},
"field_name": {
"type": "string",
"description": "sdf.bind binding name holding the SdfField."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Evaluate SDF",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Capture a saved model animationView timeline or turntable as a downloadable MP4. Use file: "project:<slug>"; inline code, GIF and PNG-sequence output are not supported on this hosted server. Limits: 60 seconds, 60 fps, 1800 frames, 200 MiB. Turntable width/height are even and at most 2048; timeline frames are 1920×1080. Returns downloads[].url with a 24-hour expiry; local_only links can expire earlier on restart. A completed capture with collisions remains ok:true, verified:false. This is rendered CAD, without synchronized electronics playback, audio, or video editing.
| Parameter | Type | Description |
|---|---|---|
| fps | number | Override the animationView record's fps. |
| file * | string | Saved project source: project:<slug> or a Studio /p/<slug> URL. The server materializes source and attached assets; inline code is not supported. |
| hide | array | Hide matching feature ids / assembly part names in the rendered frames. Mutually exclusive with focus. Render-only; does not affect pose verification. |
| focus | array | Show only matching feature ids / assembly part names in the rendered frames. Mutually exclusive with hide. Render-only; does not affect pose verification. |
| width | integer | Turntable frame width in px (default 1080; even for MP4). |
| height | integer | Turntable frame height in px (default 1080; even for MP4). |
| preset | string | Turntable look: 'publish' (default; studio product shot) or 'default' (engineering look). |
| shadow | boolean | Turntable + publish: soft contact shadow under the model (default true). |
| no_verify | boolean | Skip the animation-pose interference verification (default: verify on). |
| turntable | boolean | Seamless 360° orbit of the model instead of the animationView timeline. |
| background | string | Turntable + publish: 'white' (default), 'light', 'dark', 'black', '#rrggbb', or 'transparent' (frames_dir only — MP4/GIF have no usable alpha). |
| duration_ms | number | Turntable: one full revolution in ms (default 6000). |
| environment | string | Turntable: HDRI environment override ('studio', 'softbox', 'neutral', 'outdoor', 'warehouse', a URL, or 'none'). |
| output_path | string | Download filename ending in .mp4. The server chooses the directory; the result returns downloads[].url. |
| verify_every | integer | Additionally verify at every n-th frame time of the fps schedule (unioned with the keyframe sample set). |
| elevation_deg | number | Turntable: camera elevation above the horizon in degrees (default 22). |
{
"name": "capture_animation",
"title": "Capture Animation",
"description": "Capture a saved model animationView timeline or turntable as a downloadable MP4. Use file: \"project:<slug>\"; inline code, GIF and PNG-sequence output are not supported on this hosted server. Limits: 60 seconds, 60 fps, 1800 frames, 200 MiB. Turntable width/height are even and at most 2048; timeline frames are 1920×1080. Returns downloads[].url with a 24-hour expiry; local_only links can expire earlier on restart. A completed capture with collisions remains ok:true, verified:false. This is rendered CAD, without synchronized electronics playback, audio, or video editing.",
"inputSchema": {
"type": "object",
"required": [
"file"
],
"properties": {
"fps": {
"type": "number",
"maximum": 60,
"description": "Override the animationView record's fps.",
"exclusiveMinimum": 0
},
"file": {
"type": "string",
"description": "Saved project source: project:<slug> or a Studio /p/<slug> URL. The server materializes source and attached assets; inline code is not supported."
},
"hide": {
"type": "array",
"items": {
"type": "string"
},
"description": "Hide matching feature ids / assembly part names in the rendered frames. Mutually exclusive with focus. Render-only; does not affect pose verification."
},
"focus": {
"type": "array",
"items": {
"type": "string"
},
"description": "Show only matching feature ids / assembly part names in the rendered frames. Mutually exclusive with hide. Render-only; does not affect pose verification."
},
"width": {
"type": "integer",
"maximum": 2048,
"minimum": 64,
"description": "Turntable frame width in px (default 1080; even for MP4)."
},
"height": {
"type": "integer",
"maximum": 2048,
"minimum": 64,
"description": "Turntable frame height in px (default 1080; even for MP4)."
},
"preset": {
"enum": [
"default",
"publish"
],
"type": "string",
"description": "Turntable look: 'publish' (default; studio product shot) or 'default' (engineering look)."
},
"shadow": {
"type": "boolean",
"description": "Turntable + publish: soft contact shadow under the model (default true)."
},
"no_verify": {
"type": "boolean",
"default": false,
"description": "Skip the animation-pose interference verification (default: verify on)."
},
"turntable": {
"type": "boolean",
"default": false,
"description": "Seamless 360° orbit of the model instead of the animationView timeline."
},
"background": {
"type": "string",
"description": "Turntable + publish: 'white' (default), 'light', 'dark', 'black', '#rrggbb', or 'transparent' (frames_dir only — MP4/GIF have no usable alpha)."
},
"duration_ms": {
"type": "number",
"maximum": 60000,
"minimum": 500,
"description": "Turntable: one full revolution in ms (default 6000)."
},
"environment": {
"type": "string",
"description": "Turntable: HDRI environment override ('studio', 'softbox', 'neutral', 'outdoor', 'warehouse', a URL, or 'none')."
},
"output_path": {
"type": "string",
"description": "Download filename ending in .mp4. The server chooses the directory; the result returns downloads[].url."
},
"verify_every": {
"type": "integer",
"minimum": 1,
"description": "Additionally verify at every n-th frame time of the fps schedule (unioned with the keyframe sample set)."
},
"elevation_deg": {
"type": "number",
"maximum": 89,
"minimum": -89,
"description": "Turntable: camera elevation above the horizon in degrees (default 22)."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Capture Animation",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}
}Use this when you need to LOOK at a kernelCAD model — render its script to deterministic PNG views for visual self-check (the visual half of the evaluate → render → inspect → fix loop), with NO studio or dev server required. Pass { code } (inline source) or { file } (a .kcad.ts path), exactly one. Renders the canonical engineering views (front, right, top, iso — pass { views } for a subset, e.g. ["iso"] for fastest iteration) plus an optional { pose: "<az>,<el>" } arbitrary camera angle (degrees; az=0,el=0 is front, +az rotates CCW around +Z, +el lifts the camera). NO STUDIO / DEV-SERVER REQUIRED: a prebuilt static player (dist/headless-player) is served from an ephemeral local port automatically; a running studio dev server is used as fallback, and { base_url } forces one. The only environment dependency is playwright chromium (npx playwright install chromium). Pass { focus } or { hide } (arrays of feature ids or assembly part names, mutually exclusive) to isolate parts — same semantics as `kernelcad render --focus/--hide`. Pass { section: { axis, position, flip? } } to cut a cross-section and inspect INTERIOR geometry (wall thickness, internal pockets, whether a bore runs through) rather than only the outer shell. Pass { explode: { factor, mode? } } to pull a multi-part assembly apart (mode: "mate-axis" default, or "radial") using the same mesher as `kernelcad render --explode` — requires assembly.model()/solvedModel(). PNGs are written to { out_dir } (default: a fresh temp session directory) and returned as absolute paths with per-view camera descriptions (kernelCAD is Z-up). Mechanism truth runs first, same protocol as `kernelcad render`: a broken mechanism still renders but every tile is watermarked MECHANISM BROKEN (KERNELCAD_RENDER_STRICT=1 refuses instead); read { mechanism, mechanism_failure_codes }. The probe runs full BREP interference sweeps and can dominate latency on large assemblies — pass { no_mechanism_check: true } for fast iteration (the preview then reports mechanism: "unverified"; ignored under strict mode). Pass { overlay: 'zebra' | 'curvature' | 'continuity' } for a surface-quality visualisation (zebra stripes from vertex normals, curvature as vertex colours, continuity edges coloured by G0/G1/G2/broken) — numbers come from inspect({ of: 'continuity' | 'curvature' }); the overlay is the picture. PUBLISH PRESET: pass { preset: 'publish' } for a share-ready studio product shot (gallery tile, social post, README image, product page): key/fill/rim lights + room reflections, soft contact shadow, clean backdrop ({ background: 'white' (default) | 'light' | 'dark' | 'black' | '#rrggbb' | 'transparent' } — transparent gives a PNG with alpha), { shadow: false } to drop the shadow, 2× supersampled anti-aliasing, 30° lens, the model silhouette centred and auto-framed with ~11% air (a script's setCameraTarget is ignored), per-part colours/materials as authored, no watermark. With no views/pose it renders ONE image named 'hero' (3/4 front-right, az=30°, el=22°) at 1600×1200; width/height go up to 2048; views/pose still work under the preset. Output is deterministic for the same input. For a 360° loop use capture_animation({ turntable: true }). INSPECTION SHEET: { sheet: true } renders all seven views (iso, front, back, left, right, top, bottom) and adds one labelled image named 'sheet' tiling them — do not call a model done because it compiled; call it done when every tile of the sheet matches the request. Returns { ok, images: [{ name, path, description }], out_dir, bounds, mechanism, render_source, render_ms, diagnostics }. PATHS ARE LOCAL to the machine running the MCP server — local stdio clients read them directly; hosted/remote clients should use open_in_studio instead. Hosted server: the PNGs come back IN the result as image content (up to ~1.5 MB total; larger sets are link-only) and each `images[i].url` is an HTTPS link that expires after 24 h. `images[].path` is a server-side path you cannot open. Works with
| Parameter | Type | Description |
|---|---|---|
| code | string | Inline kernelCAD script source. Mutually exclusive with file. Relative imports resolve against a temp dir — use file for scripts with relative lib.fromSTEP(...) imports. |
| file | string | Path to a .kcad.ts script on disk. Mutually exclusive with code. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| hide | array | Hide matching feature ids / assembly part names. Mutually exclusive with focus. |
| pose | string | Extra arbitrary camera pose '<az>,<el>' in degrees, e.g. '30,20'. |
| focus | array | Show only matching feature ids / assembly part names. Mutually exclusive with hide. |
| sheet | boolean | Also write one labelled image 'sheet' tiling every rendered view. With no views it renders all seven (adds back, left, bottom) — use it before calling a model done, so a missing cutout on the back or underside is not missed. |
| views | array | Canonical views to render as an array, e.g. ["iso"] or ["front","top"] (default: all four). Fewer views = faster. |
| width | integer | Per-view tile width in px (default 768; 1600 under preset: 'publish'). |
| height | integer | Per-view tile height in px (default 768; 1200 under preset: 'publish'). |
| intent | string | 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. |
{
"name": "render_preview",
"title": "Render Preview",
"description": "Use this when you need to LOOK at a kernelCAD model — render its script to deterministic PNG views for visual self-check (the visual half of the evaluate → render → inspect → fix loop), with NO studio or dev server required. Pass { code } (inline source) or { file } (a .kcad.ts path), exactly one. Renders the canonical engineering views (front, right, top, iso — pass { views } for a subset, e.g. [\"iso\"] for fastest iteration) plus an optional { pose: \"<az>,<el>\" } arbitrary camera angle (degrees; az=0,el=0 is front, +az rotates CCW around +Z, +el lifts the camera). NO STUDIO / DEV-SERVER REQUIRED: a prebuilt static player (dist/headless-player) is served from an ephemeral local port automatically; a running studio dev server is used as fallback, and { base_url } forces one. The only environment dependency is playwright chromium (npx playwright install chromium). Pass { focus } or { hide } (arrays of feature ids or assembly part names, mutually exclusive) to isolate parts — same semantics as `kernelcad render --focus/--hide`. Pass { section: { axis, position, flip? } } to cut a cross-section and inspect INTERIOR geometry (wall thickness, internal pockets, whether a bore runs through) rather than only the outer shell. Pass { explode: { factor, mode? } } to pull a multi-part assembly apart (mode: \"mate-axis\" default, or \"radial\") using the same mesher as `kernelcad render --explode` — requires assembly.model()/solvedModel(). PNGs are written to { out_dir } (default: a fresh temp session directory) and returned as absolute paths with per-view camera descriptions (kernelCAD is Z-up). Mechanism truth runs first, same protocol as `kernelcad render`: a broken mechanism still renders but every tile is watermarked MECHANISM BROKEN (KERNELCAD_RENDER_STRICT=1 refuses instead); read { mechanism, mechanism_failure_codes }. The probe runs full BREP interference sweeps and can dominate latency on large assemblies — pass { no_mechanism_check: true } for fast iteration (the preview then reports mechanism: \"unverified\"; ignored under strict mode). Pass { overlay: 'zebra' | 'curvature' | 'continuity' } for a surface-quality visualisation (zebra stripes from vertex normals, curvature as vertex colours, continuity edges coloured by G0/G1/G2/broken) — numbers come from inspect({ of: 'continuity' | 'curvature' }); the overlay is the picture. PUBLISH PRESET: pass { preset: 'publish' } for a share-ready studio product shot (gallery tile, social post, README image, product page): key/fill/rim lights + room reflections, soft contact shadow, clean backdrop ({ background: 'white' (default) | 'light' | 'dark' | 'black' | '#rrggbb' | 'transparent' } — transparent gives a PNG with alpha), { shadow: false } to drop the shadow, 2× supersampled anti-aliasing, 30° lens, the model silhouette centred and auto-framed with ~11% air (a script's setCameraTarget is ignored), per-part colours/materials as authored, no watermark. With no views/pose it renders ONE image named 'hero' (3/4 front-right, az=30°, el=22°) at 1600×1200; width/height go up to 2048; views/pose still work under the preset. Output is deterministic for the same input. For a 360° loop use capture_animation({ turntable: true }). INSPECTION SHEET: { sheet: true } renders all seven views (iso, front, back, left, right, top, bottom) and adds one labelled image named 'sheet' tiling them — do not call a model done because it compiled; call it done when every tile of the sheet matches the request. Returns { ok, images: [{ name, path, description }], out_dir, bounds, mechanism, render_source, render_ms, diagnostics }. PATHS ARE LOCAL to the machine running the MCP server — local stdio clients read them directly; hosted/remote clients should use open_in_studio instead.\nHosted server: the PNGs come back IN the result as image content (up to ~1.5 MB total; larger sets are link-only) and each `images[i].url` is an HTTPS link that expires after 24 h. `images[].path` is a server-side path you cannot open. Works with",
"inputSchema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Inline kernelCAD script source. Mutually exclusive with file. Relative imports resolve against a temp dir — use file for scripts with relative lib.fromSTEP(...) imports."
},
"file": {
"type": "string",
"description": "Path to a .kcad.ts script on disk. Mutually exclusive with code. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"hide": {
"type": "array",
"items": {
"type": "string"
},
"description": "Hide matching feature ids / assembly part names. Mutually exclusive with focus."
},
"pose": {
"type": "string",
"description": "Extra arbitrary camera pose '<az>,<el>' in degrees, e.g. '30,20'."
},
"focus": {
"type": "array",
"items": {
"type": "string"
},
"description": "Show only matching feature ids / assembly part names. Mutually exclusive with hide."
},
"sheet": {
"type": "boolean",
"default": false,
"description": "Also write one labelled image 'sheet' tiling every rendered view. With no views it renders all seven (adds back, left, bottom) — use it before calling a model done, so a missing cutout on the back or underside is not missed."
},
"views": {
"type": "array",
"items": {
"enum": [
"front",
"right",
"top",
"iso"
],
"type": "string"
},
"description": "Canonical views to render as an array, e.g. [\"iso\"] or [\"front\",\"top\"] (default: all four). Fewer views = faster."
},
"width": {
"type": "integer",
"maximum": 2048,
"minimum": 64,
"description": "Per-view tile width in px (default 768; 1600 under preset: 'publish')."
},
"height": {
"type": "integer",
"maximum": 2048,
"minimum": 64,
"description": "Per-view tile height in px (default 768; 1200 under preset: 'publish')."
},
"intent": {
"type": "string",
"maxLength": 2000,
"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."
},
"preset": {
"enum": [
"default",
"publish"
],
"type": "string",
"description": "Render look: 'default' (engineering review) or 'publish' (studio product shot for sharing; one 'hero' image unless views/pose are given)."
},
"shadow": {
"type": "boolean",
"description": "preset 'publish' only: soft contact shadow under the model (default true)."
},
"explode": {
"type": "object",
"required": [
"factor"
],
"properties": {
"mode": {
"enum": [
"radial",
"mate-axis"
],
"type": "string"
},
"factor": {
"type": "number",
"minimum": 0
}
},
"description": "Pull a multi-part assembly apart for the preview. factor ≥ 0 scales spacing by part size; mode is 'mate-axis' (default, along parent mate/joint axes) or 'radial' (away from the assembly centroid). Requires the script to return assembly.model() / solvedModel().",
"additionalProperties": false
},
"out_dir": {
"type": "string",
"description": "Directory for the PNGs (created if missing). Default: a fresh temp session dir."
},
"overlay": {
"enum": [
"zebra",
"curvature",
"continuity"
],
"type": "string",
"description": "Surface-quality overlay: 'zebra' (reflection stripes), 'curvature' (Gaussian vertex colours), 'continuity' (edges coloured G2 green / G1 yellow / G0 orange / broken red). Built as coloured STL bands through this same pipeline."
},
"section": {
"type": "object",
"required": [
"axis",
"position"
],
"properties": {
"axis": {
"enum": [
"x",
"y",
"z"
],
"type": "string"
},
"flip": {
"type": "boolean",
"default": false
},
"position": {
"type": "number"
}
},
"description": "Cut the model with one axis-aligned section plane to inspect INTERIOR structure (wall thickness, internal pockets, whether a bore runs through) instead of only the outer shell. position is in mm along the axis (kernelCAD Z-up frame); flip keeps the +axis side (default keeps the -axis side).",
"additionalProperties": false
},
"shading": {
"enum": [
"smooth",
"flat"
],
"type": "string",
"description": "Mesh shading: 'smooth' uses the kernel's vertex normals (default); 'flat' uses face normals to expose tessellation / surface wobble."
},
"base_url": {
"type": "string",
"description": "Advanced: force a specific render server (e.g. a running studio dev server) instead of the bundled static player."
},
"background": {
"type": "string",
"description": "preset 'publish' only: 'white' (default), 'light', 'dark', 'black', 'transparent' (PNG alpha), or '#rrggbb'."
},
"environment": {
"type": "string",
"description": "HDRI environment override: preset ('studio', 'softbox', 'neutral', 'outdoor', 'warehouse'), a URL, or 'none' for the default three-light rig."
},
"no_watermark": {
"type": "boolean",
"default": false,
"description": "Suppress the kernelCAD version watermark."
},
"no_mechanism_check": {
"type": "boolean",
"default": false,
"description": "Skip the mechanism-truth probe for fast iteration on large assemblies; the preview reports mechanism: 'unverified'. Ignored under KERNELCAD_RENDER_STRICT=1."
},
"screenshot_timeout_ms": {
"type": "integer",
"maximum": 600000,
"minimum": 1000,
"description": "Playwright screenshot deadline in milliseconds. Default leaves Playwright's 30 s in place; raise it for heavy lofts or a slow machine."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Render Preview",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}
}Use this when you need to confirm or override the open facts in an assumption ledger from trace_from_image (missing scale, inferred/assumed values) before committing geometry built from a reference photo. Reads the persisted `<model>.ledger.json` at `ledger_path`, applies each resolution — `{ id, confirm: true }` to accept a fact as-is, or `{ id, value }` to override it — rewrites the ledger file, and returns the updated ledger plus `paramOverrides` (factId -> value) to feed straight into `set_param`. Pair with the `kernelcad-from-reference` skill.
| Parameter | Type | Description |
|---|---|---|
| ledger_path * | string | Path to the `<model>.ledger.json` file persisted alongside the traced source. |
| resolutions * | array | One resolution per ledger fact id to act on. |
{
"name": "resolve_assumptions",
"title": "Resolve Image Assumptions",
"description": "Use this when you need to confirm or override the open facts in an assumption ledger from trace_from_image (missing scale, inferred/assumed values) before committing geometry built from a reference photo. Reads the persisted `<model>.ledger.json` at `ledger_path`, applies each resolution — `{ id, confirm: true }` to accept a fact as-is, or `{ id, value }` to override it — rewrites the ledger file, and returns the updated ledger plus `paramOverrides` (factId -> value) to feed straight into `set_param`. Pair with the `kernelcad-from-reference` skill.",
"inputSchema": {
"type": "object",
"required": [
"ledger_path",
"resolutions"
],
"properties": {
"ledger_path": {
"type": "string",
"description": "Path to the `<model>.ledger.json` file persisted alongside the traced source."
},
"resolutions": {
"type": "array",
"items": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string",
"description": "Matches a `facts[].id` in the ledger."
},
"value": {
"type": [
"string",
"number",
"boolean",
"array",
"object"
],
"description": "Overrides the fact's value; marks it `overridden`."
},
"confirm": {
"type": "boolean",
"description": "Accepts the fact as-is; marks it `confirmed`."
}
}
},
"description": "One resolution per ledger fact id to act on."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Resolve Image Assumptions",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to know whether a part will hold a load. Runs a linear-static structural study and returns evidence — peak von Mises stress (MPa), peak displacement (mm), the minimum safety factor against the material yield (taken away from the clamp-singular edges of the fixed faces; the raw clamp-edge peak is reported separately as peakAtSupportMPa), per-region hot spots named by @kc[...] face ref, mesh trust flags, an equilibrium residual, and (CalculiX only) stress-heatmap PNG paths. The study is EITHER declared in the script with `shape.feaStudy({ material, fixed, loads, meshSize?, minSafetyFactor? })` OR passed on the call against the shape the script returns: { code: 'return box(100, 20, 10);', material: 'aluminum-6061', fixed: { atX: 0 }, loads: [{ faces: { atX: 100 }, force: [0, 0, -200] }] }. Faces are a FaceQuery ({ atX | atY | atZ, byNormal: 'Z', ofSurfaceType, near: [x,y,z], ... }; with near it names the ONE matching face nearest the point), a face label ('top', 'bottom', 'left', 'right', 'front', 'back'; it must name ONE face — after a boolean 'top' can be several, which is an error listing them) or an @kc[...] ref. Force is the TOTAL [Fx, Fy, Fz] in N on those faces (a scalar force + direction is accepted). Materials: mild-steel, aluminum-6061, pla, petg, abs, asa, nylon (aliases steel, aluminum), or { E, nu, yield } in MPa. Solver (`solver`, default 'auto'): CalculiX + gmsh quadratic tets when that toolchain is installed; otherwise the built-in in-process voxel solver (8-node incompatible-mode bricks), which needs nothing installed and is marked summary.solver 'in-process-voxel' with trust.meshTrusted false — an estimate (accurate for prismatic bending, approximate at curved faces and notches), never a verified pass. solver: 'calculix' fails up front with fea.solver.unavailable and the install command when the toolchain is absent. Also: `study` (a declared study name; default the last), `output_dir` (keeps the deck / summary JSON), `mesh_size` (mm, overrides the study for this run), `heatmaps: false` for a numbers-only run. CalculiX mesh refinement is automatic: when the stress is untrusted only because the solver's error estimate is high, it re-solves once at 0.75x the element size (inside the element budget), with summary.refinement listing each pass. `refine: false` solves once.
| Parameter | Type | Description |
|---|---|---|
| code | string | Inline kernelCAD script source (mutually exclusive with file). |
| file | string | Path to a .kcad.ts script declaring at least one feaStudy. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| fixed | ["string","object"] | Inline study: faces held fixed — a FaceQuery like { atX: 0 }, a face label like 'bottom', or an @kc[...] ref. |
| loads | array | Inline study: loads, each { faces, force: [Fx, Fy, Fz] } — total force in N on those faces. |
| study | string | Name of the declared study to run; defaults to the last declared one. |
| refine | boolean | One automatic finer pass (0.75x element size) when the stress is untrusted, inside the element budget (default true). false: one solve at mesh_size. |
| solver | string | 'auto' (default): CalculiX when installed, else in-process. 'calculix': require it. 'in-process': always the built-in voxel solver. |
| heatmaps | boolean | Render stress heatmap PNGs (default true). |
| material | ["string","object"] | Inline study: material grade name (e.g. 'aluminum-6061') or { E, nu, yield } in MPa. |
| mesh_size | number | Target element size in mm, overriding the study for this run. |
| output_dir | string | Directory for the solver deck, results, summary JSON and heatmap PNGs. |
| mesh_timeout_ms | number | Wall-clock budget for meshing (default 120000). |
| solve_timeout_ms | number | Wall-clock budget for the solve (default 300000). |
| min_safety_factor | number | Inline study: required minimum safety factor; below it the call fails with fea.safety-factor.below-min. |
{
"name": "run_fea",
"title": "Run Structural FEA",
"description": "Use this when you need to know whether a part will hold a load. Runs a linear-static structural study and returns evidence — peak von Mises stress (MPa), peak displacement (mm), the minimum safety factor against the material yield (taken away from the clamp-singular edges of the fixed faces; the raw clamp-edge peak is reported separately as peakAtSupportMPa), per-region hot spots named by @kc[...] face ref, mesh trust flags, an equilibrium residual, and (CalculiX only) stress-heatmap PNG paths.\nThe study is EITHER declared in the script with `shape.feaStudy({ material, fixed, loads, meshSize?, minSafetyFactor? })` OR passed on the call against the shape the script returns: { code: 'return box(100, 20, 10);', material: 'aluminum-6061', fixed: { atX: 0 }, loads: [{ faces: { atX: 100 }, force: [0, 0, -200] }] }. Faces are a FaceQuery ({ atX | atY | atZ, byNormal: 'Z', ofSurfaceType, near: [x,y,z], ... }; with near it names the ONE matching face nearest the point), a face label ('top', 'bottom', 'left', 'right', 'front', 'back'; it must name ONE face — after a boolean 'top' can be several, which is an error listing them) or an @kc[...] ref. Force is the TOTAL [Fx, Fy, Fz] in N on those faces (a scalar force + direction is accepted). Materials: mild-steel, aluminum-6061, pla, petg, abs, asa, nylon (aliases steel, aluminum), or { E, nu, yield } in MPa.\nSolver (`solver`, default 'auto'): CalculiX + gmsh quadratic tets when that toolchain is installed; otherwise the built-in in-process voxel solver (8-node incompatible-mode bricks), which needs nothing installed and is marked summary.solver 'in-process-voxel' with trust.meshTrusted false — an estimate (accurate for prismatic bending, approximate at curved faces and notches), never a verified pass. solver: 'calculix' fails up front with fea.solver.unavailable and the install command when the toolchain is absent.\nAlso: `study` (a declared study name; default the last), `output_dir` (keeps the deck / summary JSON), `mesh_size` (mm, overrides the study for this run), `heatmaps: false` for a numbers-only run. CalculiX mesh refinement is automatic: when the stress is untrusted only because the solver's error estimate is high, it re-solves once at 0.75x the element size (inside the element budget), with summary.refinement listing each pass. `refine: false` solves once.",
"inputSchema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Inline kernelCAD script source (mutually exclusive with file)."
},
"file": {
"type": "string",
"description": "Path to a .kcad.ts script declaring at least one feaStudy. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"fixed": {
"type": [
"string",
"object"
],
"description": "Inline study: faces held fixed — a FaceQuery like { atX: 0 }, a face label like 'bottom', or an @kc[...] ref."
},
"loads": {
"type": "array",
"items": {
"type": "object"
},
"description": "Inline study: loads, each { faces, force: [Fx, Fy, Fz] } — total force in N on those faces."
},
"study": {
"type": "string",
"description": "Name of the declared study to run; defaults to the last declared one."
},
"refine": {
"type": "boolean",
"description": "One automatic finer pass (0.75x element size) when the stress is untrusted, inside the element budget (default true). false: one solve at mesh_size."
},
"solver": {
"enum": [
"auto",
"calculix",
"in-process"
],
"type": "string",
"description": "'auto' (default): CalculiX when installed, else in-process. 'calculix': require it. 'in-process': always the built-in voxel solver."
},
"heatmaps": {
"type": "boolean",
"description": "Render stress heatmap PNGs (default true)."
},
"material": {
"type": [
"string",
"object"
],
"description": "Inline study: material grade name (e.g. 'aluminum-6061') or { E, nu, yield } in MPa."
},
"mesh_size": {
"type": "number",
"description": "Target element size in mm, overriding the study for this run."
},
"output_dir": {
"type": "string",
"description": "Directory for the solver deck, results, summary JSON and heatmap PNGs."
},
"mesh_timeout_ms": {
"type": "number",
"description": "Wall-clock budget for meshing (default 120000)."
},
"solve_timeout_ms": {
"type": "number",
"description": "Wall-clock budget for the solve (default 300000)."
},
"min_safety_factor": {
"type": "number",
"description": "Inline study: required minimum safety factor; below it the call fails with fea.safety-factor.below-min."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Run Structural FEA",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}
}Use this when you need a structural check's context without paying for a solve. Read-only: returns the stored summary of a previous run_fea (pass the same `output_dir`), whether the CalculiX + gmsh toolchain is available on this machine (with the install command when it is not; run_fea then uses its in-process voxel solver — toolchain.default_solver says which), and the FEA material table with real E / Poisson / yield numbers so a grade is chosen against data rather than from memory. Never meshes, solves, or writes.
| Parameter | Type | Description |
|---|---|---|
| output_dir | string | Directory a previous run_fea wrote to; omit for toolchain status + material table only. |
{
"name": "fea_summary",
"title": "Get FEA Summary",
"description": "Use this when you need a structural check's context without paying for a solve. Read-only: returns the stored summary of a previous run_fea (pass the same `output_dir`), whether the CalculiX + gmsh toolchain is available on this machine (with the install command when it is not; run_fea then uses its in-process voxel solver — toolchain.default_solver says which), and the FEA material table with real E / Poisson / yield numbers so a grade is chosen against data rather than from memory. Never meshes, solves, or writes.",
"inputSchema": {
"type": "object",
"properties": {
"output_dir": {
"type": "string",
"description": "Directory a previous run_fea wrote to; omit for toolchain status + material table only."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Get FEA Summary",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when evaluate_script reported an error and you want the fix applied rather than described. Takes the candidates why_did_this_fail derives for a diagnostic, applies them one at a time, re-evaluates after each, and keeps the first that clears the diagnostic without introducing new errors. Never edits outside the repair region (failing feature statement + its input statements + the param() lines it reads) — an out-of-region patch is refused with tool.repair.out-of-region. Returns the repaired source in `new_code` (the caller persists it), a unified `diff`, and before/after health maps. Pass { file? | code?, diagnostic?: '<id>'|'first-error', strategy?: 'apply-first'|'try-all'|'dry-run', max_attempts?: number }.
| Parameter | Type | Description |
|---|---|---|
| code | string | Inline kernelCAD script source. |
| file | string | Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| intent | string | 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. |
| strategy | string | 'try-all' (default) walks candidates until one clears the diagnostic; 'apply-first' applies only the top candidate and reports what it did; 'dry-run' previews every candidate patch without evaluating. |
| diagnostic | string | Diagnostic id from why_did_this_fail's `targetDiagnosticId` / `candidates[].diagnosticId`, or 'first-error' (default) for the first error-severity diagnostic. |
| max_attempts | integer | Upper bound on candidates attempted (default 3). Ignored by apply-first and dry-run. |
{
"name": "repair_script",
"title": "Repair CAD Script",
"description": "Use this when evaluate_script reported an error and you want the fix applied rather than described. Takes the candidates why_did_this_fail derives for a diagnostic, applies them one at a time, re-evaluates after each, and keeps the first that clears the diagnostic without introducing new errors. Never edits outside the repair region (failing feature statement + its input statements + the param() lines it reads) — an out-of-region patch is refused with tool.repair.out-of-region. Returns the repaired source in `new_code` (the caller persists it), a unified `diff`, and before/after health maps. Pass { file? | code?, diagnostic?: '<id>'|'first-error', strategy?: 'apply-first'|'try-all'|'dry-run', max_attempts?: number }.",
"inputSchema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Inline kernelCAD script source."
},
"file": {
"type": "string",
"description": "Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"intent": {
"type": "string",
"maxLength": 2000,
"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."
},
"strategy": {
"enum": [
"apply-first",
"try-all",
"dry-run"
],
"type": "string",
"description": "'try-all' (default) walks candidates until one clears the diagnostic; 'apply-first' applies only the top candidate and reports what it did; 'dry-run' previews every candidate patch without evaluating."
},
"diagnostic": {
"type": "string",
"description": "Diagnostic id from why_did_this_fail's `targetDiagnosticId` / `candidates[].diagnosticId`, or 'first-error' (default) for the first error-severity diagnostic."
},
"max_attempts": {
"type": "integer",
"maximum": 10,
"minimum": 1,
"description": "Upper bound on candidates attempted (default 3). Ignored by apply-first and dry-run."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Repair CAD Script",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to know where and why a design breaks across a tolerance/dimension range, not just whether it builds at one nominal value. Declares one or more param() names with a { values: [...] } list or a { min, max, steps } range (number params are bisected; choice/string params are evaluated as discrete points), re-evaluates the script once per cartesian-product combination (capped at 64 combos — exceeding it truncates to the first 64 and emits kinematic.sweep-tolerance.combo-cap-exceeded), and measures every requirement in the S2 ledger (script require(), dfmSpec, gated FEA, mechanical intent) plus the standard gates on each combo: interference, mounting-hole diameter agreement, and joint-axis binding (all three default on); reachability only when gates.reachable names a tip_link + target. After the coarse grid it bisects each numeric pass/fail transition down to boundary_tolerance and reports the boundary value, the failing side, and the binding requirement/gate names (e.g. "wall fails below 1.840 mm; binding: wall"). Returns per-combo verdicts, firstFailure per gate, firstRequirementFailure per requirement, boundaries[], and a coverage statement that says "checked at N points plus boundaries", never "proven".
| Parameter | Type | Description |
|---|---|---|
| code | string | Inline kernelCAD script source. |
| file | string | Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| gates | object | Which standard gates to run per combo. |
| params * | object | param() name -> { values: [number|string, ...] } or { min, max, steps }. |
| assembly | string | Assembly name; defaults to the first captured assembly. |
| boundary_budget | number | Maximum extra evaluations spent bisecting boundaries. Default 64; 0 skips bisection. |
| boundary_tolerance | number | Absolute parameter tolerance for boundary bisection. Default 0.001. |
{
"name": "sweep_tolerance",
"title": "Sweep Tolerance Range",
"description": "Use this when you need to know where and why a design breaks across a tolerance/dimension range, not just whether it builds at one nominal value. Declares one or more param() names with a { values: [...] } list or a { min, max, steps } range (number params are bisected; choice/string params are evaluated as discrete points), re-evaluates the script once per cartesian-product combination (capped at 64 combos — exceeding it truncates to the first 64 and emits kinematic.sweep-tolerance.combo-cap-exceeded), and measures every requirement in the S2 ledger (script require(), dfmSpec, gated FEA, mechanical intent) plus the standard gates on each combo: interference, mounting-hole diameter agreement, and joint-axis binding (all three default on); reachability only when gates.reachable names a tip_link + target. After the coarse grid it bisects each numeric pass/fail transition down to boundary_tolerance and reports the boundary value, the failing side, and the binding requirement/gate names (e.g. \"wall fails below 1.840 mm; binding: wall\"). Returns per-combo verdicts, firstFailure per gate, firstRequirementFailure per requirement, boundaries[], and a coverage statement that says \"checked at N points plus boundaries\", never \"proven\".",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"code": {
"type": "string",
"description": "Inline kernelCAD script source."
},
"file": {
"type": "string",
"description": "Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"gates": {
"type": "object",
"properties": {
"reachable": {
"type": "object",
"required": [
"tip_link",
"target_position"
],
"properties": {
"tip_link": {
"type": "string"
},
"target_position": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
},
"target_orientation": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
}
},
"description": "Runs the reachability gate when set."
},
"joint_axis": {
"type": "boolean",
"description": "Default true."
},
"interference": {
"type": "boolean",
"description": "Default true."
},
"mounting_holes": {
"type": "boolean",
"description": "Default true."
}
},
"description": "Which standard gates to run per combo."
},
"params": {
"type": "object",
"description": "param() name -> { values: [number|string, ...] } or { min, max, steps }."
},
"assembly": {
"type": "string",
"description": "Assembly name; defaults to the first captured assembly."
},
"boundary_budget": {
"type": "number",
"description": "Maximum extra evaluations spent bisecting boundaries. Default 64; 0 skips bisection."
},
"boundary_tolerance": {
"type": "number",
"description": "Absolute parameter tolerance for boundary bisection. Default 0.001."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Sweep Tolerance Range",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to know WHAT MATERIAL changed between two versions of a model, not just how much. The deeper sibling of diff_scripts: a volume delta alone is ambiguous (a boss that grew and a pocket that deepened report the same magnitude, and a part that only moved reports zero), so this tool answers it with geometry instead of pixels. Baseline is { base_file } or { base_code }; the revised side is either another script ({ file } or { code }) or the SAME script re-lowered with { params } overrides — a bag of declared param() name -> new value, which is the one-script form a parameter sweep actually asks for. Bodies pair by name and fall back to declaration-order positional pairing; anything left over is listed in `unmatched` and raises diff.body.unmatched. Per matched body it returns addedMm3 = volume(revised - base), removedMm3 = volume(base - revised), commonMm3 = volume of the overlap from boolean intersection, exact bbox with min/max/extent deltas, face / edge / hole count deltas (hole counts reuse the cylindrical-hole detector), maxDeviationMm (two-sided discrete Hausdorff distance between the two surfaces), and a `verdict` — identical | moved | resized | topology-changed, precedence topology-changed > resized > moved > identical. Branch on the verdict; cite the numbers. Each body also carries `faces` - WHICH faces changed: { added, removed, modified, unchangedCount } where each entry is { surfaceType (plane | cylinder | cone | sphere | torus | bspline | other), areaMm2, center, normal (planes), axis (cylinders/cones), radiusMm, ref (a stable @kc[...] face ref on the revised model when the face has a lineage name) } and a modified entry adds { before, after, offsetMm, change: 'moved' | 'resized' | 'reshaped', matchedBy: 'lineage' | 'geometry' }. Faces pair by lineage first (the feature and role that made them, so a translated box reports six moved faces, not six removed + six added), then by geometry (same surface type, parallel normal/axis, nearest centroid). Lists are deterministic and capped at 50 with a `truncated` flag and true totals (addedCount / removedCount / modifiedCount). summary.text says it in plain language, e.g. "Body '(root)' topology-changed: 1 face added (cylinder r=3 at (20, 20, 3)), 2 faces resized (...)". Optional { render: true } also writes an overlay PNG (added green, removed red, unchanged material as a translucent ghost; the scene is a re-runnable .kcad.ts over lossless BREP sidecars) through the render_preview pipeline and fails open (the numeric diff is still returned) when that pipeline is unavailable. Read-only — never touches the active session.
| Parameter | Type | Description |
|---|---|---|
| code | string | Revised script — inline source. Mutually exclusive with params. |
| file | string | Revised script — path to a .kcad.ts file. Mutually exclusive with params. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| params | object | Param-override mode: re-lower the BASELINE with these declared param() values changed (e.g. { plateThickness: 8 }). Mutually exclusive with file/code. A name the baseline does not declare fails with the declared-param list in the message. |
| render | boolean | Also render an overlay PNG — added material green, removed material red — via the render_preview pipeline. Off by default; the numeric table is the agent-facing evidence. |
| out_dir | string | Directory for the overlay PNG, its STL inputs, and the generated overlay script. Default: a temp dir. |
| base_code | string | Baseline script — inline source. |
| base_file | string | Baseline script — path to a .kcad.ts file. |
{
"name": "diff_geometry",
"title": "Diff Model Geometry",
"description": "Use this when you need to know WHAT MATERIAL changed between two versions of a model, not just how much. The deeper sibling of diff_scripts: a volume delta alone is ambiguous (a boss that grew and a pocket that deepened report the same magnitude, and a part that only moved reports zero), so this tool answers it with geometry instead of pixels. Baseline is { base_file } or { base_code }; the revised side is either another script ({ file } or { code }) or the SAME script re-lowered with { params } overrides — a bag of declared param() name -> new value, which is the one-script form a parameter sweep actually asks for. Bodies pair by name and fall back to declaration-order positional pairing; anything left over is listed in `unmatched` and raises diff.body.unmatched. Per matched body it returns addedMm3 = volume(revised - base), removedMm3 = volume(base - revised), commonMm3 = volume of the overlap from boolean intersection, exact bbox with min/max/extent deltas, face / edge / hole count deltas (hole counts reuse the cylindrical-hole detector), maxDeviationMm (two-sided discrete Hausdorff distance between the two surfaces), and a `verdict` — identical | moved | resized | topology-changed, precedence topology-changed > resized > moved > identical. Branch on the verdict; cite the numbers. Each body also carries `faces` - WHICH faces changed: { added, removed, modified, unchangedCount } where each entry is { surfaceType (plane | cylinder | cone | sphere | torus | bspline | other), areaMm2, center, normal (planes), axis (cylinders/cones), radiusMm, ref (a stable @kc[...] face ref on the revised model when the face has a lineage name) } and a modified entry adds { before, after, offsetMm, change: 'moved' | 'resized' | 'reshaped', matchedBy: 'lineage' | 'geometry' }. Faces pair by lineage first (the feature and role that made them, so a translated box reports six moved faces, not six removed + six added), then by geometry (same surface type, parallel normal/axis, nearest centroid). Lists are deterministic and capped at 50 with a `truncated` flag and true totals (addedCount / removedCount / modifiedCount). summary.text says it in plain language, e.g. \"Body '(root)' topology-changed: 1 face added (cylinder r=3 at (20, 20, 3)), 2 faces resized (...)\". Optional { render: true } also writes an overlay PNG (added green, removed red, unchanged material as a translucent ghost; the scene is a re-runnable .kcad.ts over lossless BREP sidecars) through the render_preview pipeline and fails open (the numeric diff is still returned) when that pipeline is unavailable. Read-only — never touches the active session.",
"inputSchema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Revised script — inline source. Mutually exclusive with params."
},
"file": {
"type": "string",
"description": "Revised script — path to a .kcad.ts file. Mutually exclusive with params. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"params": {
"type": "object",
"description": "Param-override mode: re-lower the BASELINE with these declared param() values changed (e.g. { plateThickness: 8 }). Mutually exclusive with file/code. A name the baseline does not declare fails with the declared-param list in the message.",
"additionalProperties": true
},
"render": {
"type": "boolean",
"description": "Also render an overlay PNG — added material green, removed material red — via the render_preview pipeline. Off by default; the numeric table is the agent-facing evidence."
},
"out_dir": {
"type": "string",
"description": "Directory for the overlay PNG, its STL inputs, and the generated overlay script. Default: a temp dir."
},
"base_code": {
"type": "string",
"description": "Baseline script — inline source."
},
"base_file": {
"type": "string",
"description": "Baseline script — path to a .kcad.ts file."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Diff Model Geometry",
"readOnlyHint": true,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}
}Use this when the reference for a part is a 2D engineering drawing PDF (orthographic views with dimensions), not a photo. Deterministic, no vision model: reads the vector linework (stroke width, dash) and positioned text; classifies visible / hidden / center / dimension / extension lines; reads the title block scale, units and projection symbol; identifies front / top / side views by projection alignment (third- or first-angle); ties dimension text to its lines (⌀, R, 4×, ±, THRU, depth). Dimension values win over measured lengths. Rebuilds the part as the view silhouette extruded by the depth an orthogonal view shows, or a turned part revolved from its half-silhouette, plus holes from ⌀ circles with THRU or hidden-line depth. Returns `script` — a `.kcad.ts` with role-named params (width, thickness, holeDia, hole1X, dia1, step1Length …) — and `ledger`, an assumption ledger where stated dimensions are `visible`, symmetry-derived positions `inferred`, defaults `assumed` and an unstated depth `missing`; a dimension that disagrees with the linework keeps its value and records the disagreement as an open fact. With verify (default) the script is evaluated, re-projected through the svg-drawing view stage and compared: `fidelity.verdict` is match | partial | mismatch | failed with per-axis extents, hole diameters and per-view silhouette IoU. Pass `out` to write the script and its `<stem>.ledger.json` (resolve open facts with resolve_assumptions, then set_param). A scanned (raster-only) page fails with reference.drawing.raster-only — use trace_from_image for those. Hosted: give the file as an https:// URL, a data: URI (base64, max 25 MB) or "asset:<id>" from request_upload (when the file is on the user's device).
| Parameter | Type | Description |
|---|---|---|
| out | string | Write the emitted script here (a .kcad.ts path); the ledger is written beside it as <stem>.ledger.json. |
| page | integer | 1-based page to read. Default 1. |
| path | string | Path to the drawing PDF on the machine running kernelCAD. Hosted server: pass an https:// URL, a data: URI, or "asset:<id>" from request_upload — not a path on your machine. |
| intent | string | 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. |
| verify | boolean | Evaluate the rebuilt part and compare it with the drawing. Default true. |
| pdf_base64 | string | The PDF inline, base64-encoded. Use this instead of `path` against a hosted kernelCAD server. |
| projection | string | Override the projection angle read from the sheet (default: projection symbol or note, else third-angle). |
{
"name": "drawing_to_cad",
"title": "Convert Drawing to CAD",
"description": "Use this when the reference for a part is a 2D engineering drawing PDF (orthographic views with dimensions), not a photo. Deterministic, no vision model: reads the vector linework (stroke width, dash) and positioned text; classifies visible / hidden / center / dimension / extension lines; reads the title block scale, units and projection symbol; identifies front / top / side views by projection alignment (third- or first-angle); ties dimension text to its lines (⌀, R, 4×, ±, THRU, depth). Dimension values win over measured lengths. Rebuilds the part as the view silhouette extruded by the depth an orthogonal view shows, or a turned part revolved from its half-silhouette, plus holes from ⌀ circles with THRU or hidden-line depth. Returns `script` — a `.kcad.ts` with role-named params (width, thickness, holeDia, hole1X, dia1, step1Length …) — and `ledger`, an assumption ledger where stated dimensions are `visible`, symmetry-derived positions `inferred`, defaults `assumed` and an unstated depth `missing`; a dimension that disagrees with the linework keeps its value and records the disagreement as an open fact. With verify (default) the script is evaluated, re-projected through the svg-drawing view stage and compared: `fidelity.verdict` is match | partial | mismatch | failed with per-axis extents, hole diameters and per-view silhouette IoU. Pass `out` to write the script and its `<stem>.ledger.json` (resolve open facts with resolve_assumptions, then set_param). A scanned (raster-only) page fails with reference.drawing.raster-only — use trace_from_image for those. Hosted: give the file as an https:// URL, a data: URI (base64, max 25 MB) or \"asset:<id>\" from request_upload (when the file is on the user's device).",
"inputSchema": {
"type": "object",
"properties": {
"out": {
"type": "string",
"description": "Write the emitted script here (a .kcad.ts path); the ledger is written beside it as <stem>.ledger.json."
},
"page": {
"type": "integer",
"minimum": 1,
"description": "1-based page to read. Default 1."
},
"path": {
"type": "string",
"description": "Path to the drawing PDF on the machine running kernelCAD. Hosted server: pass an https:// URL, a data: URI, or \"asset:<id>\" from request_upload — not a path on your machine."
},
"intent": {
"type": "string",
"maxLength": 2000,
"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."
},
"verify": {
"type": "boolean",
"description": "Evaluate the rebuilt part and compare it with the drawing. Default true."
},
"pdf_base64": {
"type": "string",
"description": "The PDF inline, base64-encoded. Use this instead of `path` against a hosted kernelCAD server."
},
"projection": {
"enum": [
"third-angle",
"first-angle"
],
"type": "string",
"description": "Override the projection angle read from the sheet (default: projection symbol or note, else third-angle)."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Convert Drawing to CAD",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}
}Use this when you are handed an STL, OBJ or 3MF of a mostly prismatic mechanical part (plate, bracket, spacer, flange, housing block) and need an EDITABLE kernelCAD model of it rather than a faceted lib.fromSTL import — or a STEP file whose solid you need as an editable feature tree rather than a dumb lib.fromSTEP body (one solid; pass solid for a multi-solid file; the exact B-rep is tessellated finely and `source` reports the deflection the fidelity is measured to). Deterministic, measured, self-verifying: it welds and checks the mesh, segments planes and cylinders, picks the extrusion axis, slices each band and fits exact lines / arcs / circles, snaps near-round values (each snap recorded), then emits a readable .kcad.ts with named param()s — a revolve for concentric round stacks, extruded profiles otherwise, .hole()/.holes() for through, blind and counterbored bores (axial and side-drilled), .cutout() for pockets, .fillet() for constant-radius edge blends (radius measured on the sharp edge, edges grouped by radius and picked with the shortest exact edge query), boolean subtractions for what no drilling feature can reach. It then EVALUATES that script and compares it with the mesh: volume IoU (column ray casting) and symmetric surface deviation (max + RMS), over up to 4 refinement passes. Returns { script, ledger, fidelity: { maxDeviationMm, rmsMm, volumeIoU, verdict: faithful | approximate | failed, thresholds }, unmatchedRegions, features, passes }. A fillet or sharp reading is kept by which measures better; variable-radius blends and chamfers are reported, not forced. The verdict is computed from the numbers — faithful needs IoU >= min_iou AND max deviation <= max_deviation_mm AND a watertight mesh AND no unmatched region. Freeform surfaces, tilted planes and side bosses are listed in unmatchedRegions (reference.mesh.freeform-region-unmatched), never silently dropped. The ledger uses fact ids equal to param names, so resolve_assumptions on the written <out>.ledger.json yields paramOverrides for set_param. Pass { out } to write the script and ledger; the mesh itself is never modified. Hosted: give the file as an https:// URL, a data: URI (base64, max 25 MB) or "asset:<id>" from request_upload (when the file is on the user's device).
| Parameter | Type | Description |
|---|---|---|
| out | string | Write the emitted script to this .kcad.ts path and the assumption ledger to the sibling .ledger.json. |
| data | string | Mesh or STEP bytes as base64 — use when the server cannot see your filesystem. |
| file | string | Path to a .stl (binary or ASCII), .obj or .3mf mesh, or a .step/.stp file. One of file / data is required. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. Hosted server: pass an https:// URL, a data: URI, or "asset:<id>" from request_upload … |
| solid | integer | STEP only: 0-based solid to rebuild when the file holds more than one (inspect with of: "step" lists them). A multi-solid STEP without it is refused. |
| format | string | Format override; default from the extension or the content (an ISO-10303-21 header is STEP). |
| min_iou | number | Volume IoU a faithful verdict requires. Default 0.98. |
| max_passes | number | Refinement passes, 1–4. Default 4; stops early at the first faithful pass. |
| max_triangles | number | Refuse meshes above this triangle count instead of stalling. Default 300000. |
| max_deviation_mm | number | Max surface deviation (mm) a faithful verdict allows. Default max(0.25, 0.1 % of the bbox diagonal). |
| weld_tolerance_mm | number | Vertex weld distance in mm. Default max(1e-4, 1e-6 × bbox diagonal). |
{
"name": "mesh_to_features",
"title": "Fit Features to Mesh",
"description": "Use this when you are handed an STL, OBJ or 3MF of a mostly prismatic mechanical part (plate, bracket, spacer, flange, housing block) and need an EDITABLE kernelCAD model of it rather than a faceted lib.fromSTL import — or a STEP file whose solid you need as an editable feature tree rather than a dumb lib.fromSTEP body (one solid; pass solid for a multi-solid file; the exact B-rep is tessellated finely and `source` reports the deflection the fidelity is measured to). Deterministic, measured, self-verifying: it welds and checks the mesh, segments planes and cylinders, picks the extrusion axis, slices each band and fits exact lines / arcs / circles, snaps near-round values (each snap recorded), then emits a readable .kcad.ts with named param()s — a revolve for concentric round stacks, extruded profiles otherwise, .hole()/.holes() for through, blind and counterbored bores (axial and side-drilled), .cutout() for pockets, .fillet() for constant-radius edge blends (radius measured on the sharp edge, edges grouped by radius and picked with the shortest exact edge query), boolean subtractions for what no drilling feature can reach. It then EVALUATES that script and compares it with the mesh: volume IoU (column ray casting) and symmetric surface deviation (max + RMS), over up to 4 refinement passes. Returns { script, ledger, fidelity: { maxDeviationMm, rmsMm, volumeIoU, verdict: faithful | approximate | failed, thresholds }, unmatchedRegions, features, passes }. A fillet or sharp reading is kept by which measures better; variable-radius blends and chamfers are reported, not forced. The verdict is computed from the numbers — faithful needs IoU >= min_iou AND max deviation <= max_deviation_mm AND a watertight mesh AND no unmatched region. Freeform surfaces, tilted planes and side bosses are listed in unmatchedRegions (reference.mesh.freeform-region-unmatched), never silently dropped. The ledger uses fact ids equal to param names, so resolve_assumptions on the written <out>.ledger.json yields paramOverrides for set_param. Pass { out } to write the script and ledger; the mesh itself is never modified. Hosted: give the file as an https:// URL, a data: URI (base64, max 25 MB) or \"asset:<id>\" from request_upload (when the file is on the user's device).",
"inputSchema": {
"type": "object",
"properties": {
"out": {
"type": "string",
"description": "Write the emitted script to this .kcad.ts path and the assumption ledger to the sibling .ledger.json."
},
"data": {
"type": "string",
"description": "Mesh or STEP bytes as base64 — use when the server cannot see your filesystem."
},
"file": {
"type": "string",
"description": "Path to a .stl (binary or ASCII), .obj or .3mf mesh, or a .step/.stp file. One of file / data is required. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. Hosted server: pass an https:// URL, a data: URI, or \"asset:<id>\" from request_upload — not a path on your machine."
},
"solid": {
"type": "integer",
"minimum": 0,
"description": "STEP only: 0-based solid to rebuild when the file holds more than one (inspect with of: \"step\" lists them). A multi-solid STEP without it is refused."
},
"format": {
"enum": [
"stl",
"obj",
"3mf",
"step"
],
"type": "string",
"description": "Format override; default from the extension or the content (an ISO-10303-21 header is STEP)."
},
"min_iou": {
"type": "number",
"description": "Volume IoU a faithful verdict requires. Default 0.98."
},
"max_passes": {
"type": "number",
"description": "Refinement passes, 1–4. Default 4; stops early at the first faithful pass."
},
"max_triangles": {
"type": "number",
"description": "Refuse meshes above this triangle count instead of stalling. Default 300000."
},
"max_deviation_mm": {
"type": "number",
"description": "Max surface deviation (mm) a faithful verdict allows. Default max(0.25, 0.1 % of the bbox diagonal)."
},
"weld_tolerance_mm": {
"type": "number",
"description": "Vertex weld distance in mm. Default max(1e-4, 1e-6 × bbox diagonal)."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Fit Features to Mesh",
"readOnlyHint": true,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}
}Use this when you need evaluate_script (and optionally open_in_studio) for an industry / cookbook demo in ONE step — after lookup_cookbook for industry demos, prefer execute_cookbook when you need evaluate+Studio together; empty lookup is not a stop (freehand-author instead). Resolves a cookbook snippet by `id` or BM25 `query` (same ranking as lookup_cookbook), evaluates its body via evaluate_script with bounded vendor timeouts, and returns explicit status with stage resolve|evaluate|open_in_studio. Pass open_in_studio:true to publish the same script via open_in_studio after a green full evaluate (hosted MCP). dry_run:true is the fast capture-only path — it is NOT evidence the cookbook builds a solid or is safe to publish; finish with dry_run:false (default) before claiming success or opening Studio.
| Parameter | Type | Description |
|---|---|---|
| id | string | Cookbook snippet id (e.g. gt2-timing-belt-drive, extrude-rounded-rect-plate). |
| query | string | When id is omitted: natural-language query; BM25 picks the top hit (same as lookup_cookbook). |
| intent | string | 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. |
| kernel | string | Solid-modeling kernel forwarded to evaluate_script. Default 'occt'; opt-in 'smlib' uses guarded candidates with explicit OCCT fallback diagnostics. |
| dry_run | boolean | Default false. dry_run:true is NOT evidence the cookbook builds a solid — capture-only checks; do not claim success or open Studio from a dry run alone. |
| project | string | Slug of an existing project. Adds a revision to that project. Omit to start a new project when this cookbook or design is different from the one this chat already saved. |
| new_project | boolean | Pass true to start a separate project even when this cookbook was already published in this chat. |
| open_in_studio | boolean | Default false. When true, after a green full (non-dry_run) evaluate, call open_in_studio on the same script (hosted MCP). |
| continue_design | boolean | Pass true to add a revision to the design this chat is already saving, even if this call runs a different cookbook. Ignored when `project` is set. |
{
"name": "execute_cookbook",
"title": "Execute Cookbook",
"description": "Use this when you need evaluate_script (and optionally open_in_studio) for an industry / cookbook demo in ONE step — after lookup_cookbook for industry demos, prefer execute_cookbook when you need evaluate+Studio together; empty lookup is not a stop (freehand-author instead). Resolves a cookbook snippet by `id` or BM25 `query` (same ranking as lookup_cookbook), evaluates its body via evaluate_script with bounded vendor timeouts, and returns explicit status with stage resolve|evaluate|open_in_studio. Pass open_in_studio:true to publish the same script via open_in_studio after a green full evaluate (hosted MCP). dry_run:true is the fast capture-only path — it is NOT evidence the cookbook builds a solid or is safe to publish; finish with dry_run:false (default) before claiming success or opening Studio.",
"inputSchema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Cookbook snippet id (e.g. gt2-timing-belt-drive, extrude-rounded-rect-plate)."
},
"query": {
"type": "string",
"description": "When id is omitted: natural-language query; BM25 picks the top hit (same as lookup_cookbook)."
},
"intent": {
"type": "string",
"maxLength": 2000,
"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."
},
"kernel": {
"enum": [
"occt",
"smlib"
],
"type": "string",
"description": "Solid-modeling kernel forwarded to evaluate_script. Default 'occt'; opt-in 'smlib' uses guarded candidates with explicit OCCT fallback diagnostics."
},
"dry_run": {
"type": "boolean",
"default": false,
"description": "Default false. dry_run:true is NOT evidence the cookbook builds a solid — capture-only checks; do not claim success or open Studio from a dry run alone."
},
"project": {
"type": "string",
"minLength": 1,
"description": "Slug of an existing project. Adds a revision to that project. Omit to start a new project when this cookbook or design is different from the one this chat already saved."
},
"new_project": {
"type": "boolean",
"description": "Pass true to start a separate project even when this cookbook was already published in this chat."
},
"open_in_studio": {
"type": "boolean",
"default": false,
"description": "Default false. When true, after a green full (non-dry_run) evaluate, call open_in_studio on the same script (hosted MCP)."
},
"continue_design": {
"type": "boolean",
"description": "Pass true to add a revision to the design this chat is already saving, even if this call runs a different cookbook. Ignored when `project` is set."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Execute Cookbook",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}
}Use this when the user wants to start from their own STEP, IGES, native OCCT BREP, STL, OBJ, PLY, 3MF, glTF or GLB file (a part they designed elsewhere, a vendor model). Give exactly one source: url (a public https direct-download link), upload (a file the user attached in ChatGPT), or content_base64 (raw bytes, small files only). Max 50 MB. The format is detected from the bytes or file name (or pass format: 'step' | 'iges' | 'brep' | 'stl' | 'obj' | 'ply' | '3mf' | 'gltf' | 'glb'). STEP, IGES and BREP produce exact B-rep solids; IGES uses OCCT's reader and the shared topology repair pass, while BREP is OCCT's native serialization. A CAD file that does not produce a valid solid fails; it is never replaced by a mesh. STL is imported as faceted geometry. OBJ, PLY, 3MF, glTF and GLB stay source meshes. Writes the file and a starter <name>.kcad.ts into output_dir (default: a fresh temp dir), evaluates it, and returns { ok, format, model_path, script_path, code, bbox, import_report }. The report gives representation, exact_solid, mesh_fallback, repair_required, solid_count, face_count, and triangle_count. Native CAD importers fail if they do not produce an exact solid; they never substitute a mesh. Every mesh format is reported as source-mesh, not as a CAD fallback. Pass script_path as { file } to evaluate_script, add_feature, dfm_review, export and the other tools, or edit code to build on the body. Source meshes are display-only triangle geometry. Use STEP, IGES or BREP when exact CAD topology is required. A non-watertight STL is refused unless allow_open is true.
| Parameter | Type | Description |
|---|---|---|
| url | string | Public https URL that downloads a .step/.stp/.igs/.iges/.brep/.brp/.stl/.obj/.ply/.3mf/.gltf/.glb file directly. |
| name | string | Base name for the written files. Default 'imported'. |
| format | string | Override format detection. |
| upload | object | ChatGPT file reference for a file the user attached. |
| file_name | string | Original file name, used for format detection. |
| allow_open | boolean | STL only: accept a non-watertight mesh as an open shell. |
| output_dir | string | Where to write the file and starter script. Default: a new temp directory. |
| content_base64 | string | The file bytes, base64-encoded (small files). |
{
"name": "import_step",
"title": "Import STEP",
"description": "Use this when the user wants to start from their own STEP, IGES, native OCCT BREP, STL, OBJ, PLY, 3MF, glTF or GLB file (a part they designed elsewhere, a vendor model). Give exactly one source: url (a public https direct-download link), upload (a file the user attached in ChatGPT), or content_base64 (raw bytes, small files only). Max 50 MB. The format is detected from the bytes or file name (or pass format: 'step' | 'iges' | 'brep' | 'stl' | 'obj' | 'ply' | '3mf' | 'gltf' | 'glb'). STEP, IGES and BREP produce exact B-rep solids; IGES uses OCCT's reader and the shared topology repair pass, while BREP is OCCT's native serialization. A CAD file that does not produce a valid solid fails; it is never replaced by a mesh. STL is imported as faceted geometry. OBJ, PLY, 3MF, glTF and GLB stay source meshes. Writes the file and a starter <name>.kcad.ts into output_dir (default: a fresh temp dir), evaluates it, and returns { ok, format, model_path, script_path, code, bbox, import_report }. The report gives representation, exact_solid, mesh_fallback, repair_required, solid_count, face_count, and triangle_count. Native CAD importers fail if they do not produce an exact solid; they never substitute a mesh. Every mesh format is reported as source-mesh, not as a CAD fallback. Pass script_path as { file } to evaluate_script, add_feature, dfm_review, export and the other tools, or edit code to build on the body. Source meshes are display-only triangle geometry. Use STEP, IGES or BREP when exact CAD topology is required. A non-watertight STL is refused unless allow_open is true.",
"inputSchema": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "Public https URL that downloads a .step/.stp/.igs/.iges/.brep/.brp/.stl/.obj/.ply/.3mf/.gltf/.glb file directly."
},
"name": {
"type": "string",
"description": "Base name for the written files. Default 'imported'."
},
"format": {
"enum": [
"step",
"iges",
"brep",
"stl",
"obj",
"ply",
"3mf",
"gltf",
"glb"
],
"type": "string",
"description": "Override format detection."
},
"upload": {
"type": "object",
"required": [
"download_url",
"file_id"
],
"properties": {
"file_id": {
"type": "string"
},
"file_name": {
"type": "string"
},
"mime_type": {
"type": "string"
},
"download_url": {
"type": "string"
}
},
"description": "ChatGPT file reference for a file the user attached."
},
"file_name": {
"type": "string",
"description": "Original file name, used for format detection."
},
"allow_open": {
"type": "boolean",
"default": false,
"description": "STL only: accept a non-watertight mesh as an open shell."
},
"output_dir": {
"type": "string",
"description": "Where to write the file and starter script. Default: a new temp directory."
},
"content_base64": {
"type": "string",
"description": "The file bytes, base64-encoded (small files)."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Import CAD",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when the user wants to get a part made: packages the fabrication files into one directory plus a zip, and returns links to public instant-quote pages. Pass { file | code } and output_dir; optional scope ('part', default — one script's files; 'bom' — the whole assembly's BOM: per-part single-body files, per-part drawings, bom.csv/json and vendor handoff texts; 'workshop' — part pack plus cut-list CSV/JSON, DXF flats.zip, and dfm_review JSON sidecar), name (default 'part'), formats (default step, stl, 3mf, pdf-drawing, bom-csv; add 'dxf' for flat/sheet; workshop also cut-list-csv/json, dfm-json, flats-zip), tolerance (requested absolute mm for mesh exports; this runtime currently refuses it before writing), and processes ('3d-print' | 'cnc' | 'sheet-cut') to filter links (bom: also narrows which fabricated rows are packed). Each file is written by the export tool, so its gates apply; a format that fails is reported in files[] and the rest still ship. Also writes manifest.json and README.txt. quote_links lists JLC3DP, JLCCNC, PCBWay, Xometry, SendCutSend and Craftcloud with the pack file to upload to each. One body per file: multi-body files are rejected by every shop. DXF is written only for flat or sheet-metal parts. The McMaster handoff text carries part numbers only, because McMaster quantities are packs and pack sizes are not in the catalog yet. These are plain web pages: nothing is uploaded or ordered. The user opens the link and uploads the file. Run dfm_review first if you have not. Hosted server: pack files are written on the kernelCAD server and returned in downloads[].url; nothing is uploaded to a fabrication service.
| Parameter | Type | Description |
|---|---|---|
| code | string | Inline kernelCAD script source. |
| file | string | Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| name | string | Base file name (letters, digits, '.', '_', '-'). Default 'part'. |
| scope | string | Default 'part' (a single-part pack). 'bom' packs the whole assembly's BOM. 'workshop' packs shop files plus cut list, DXF flats zip, and DFM warnings JSON. |
| formats | array | Files to include. Default step, stl, 3mf, pdf-drawing, bom-csv. |
| processes | array | Only return quote links for these processes. Default: all. |
| tolerance | number | Requested absolute mesh tolerance in mm. This runtime currently returns export.mesh.tolerance-unsupported and writes no files when this is supplied. |
| output_dir * | string | Directory to write the pack into (created if missing). Hosted server: only the directory name is used; the pack is written in a server-owned directory and returned as download links. |
{
"name": "fab_pack",
"title": "Package Fabrication Files",
"description": "Use this when the user wants to get a part made: packages the fabrication files into one directory plus a zip, and returns links to public instant-quote pages. Pass { file | code } and output_dir; optional scope ('part', default — one script's files; 'bom' — the whole assembly's BOM: per-part single-body files, per-part drawings, bom.csv/json and vendor handoff texts; 'workshop' — part pack plus cut-list CSV/JSON, DXF flats.zip, and dfm_review JSON sidecar), name (default 'part'), formats (default step, stl, 3mf, pdf-drawing, bom-csv; add 'dxf' for flat/sheet; workshop also cut-list-csv/json, dfm-json, flats-zip), tolerance (requested absolute mm for mesh exports; this runtime currently refuses it before writing), and processes ('3d-print' | 'cnc' | 'sheet-cut') to filter links (bom: also narrows which fabricated rows are packed). Each file is written by the export tool, so its gates apply; a format that fails is reported in files[] and the rest still ship. Also writes manifest.json and README.txt. quote_links lists JLC3DP, JLCCNC, PCBWay, Xometry, SendCutSend and Craftcloud with the pack file to upload to each. One body per file: multi-body files are rejected by every shop. DXF is written only for flat or sheet-metal parts. The McMaster handoff text carries part numbers only, because McMaster quantities are packs and pack sizes are not in the catalog yet. These are plain web pages: nothing is uploaded or ordered. The user opens the link and uploads the file. Run dfm_review first if you have not.\nHosted server: pack files are written on the kernelCAD server and returned in downloads[].url; nothing is uploaded to a fabrication service.",
"inputSchema": {
"type": "object",
"required": [
"output_dir"
],
"properties": {
"code": {
"type": "string",
"description": "Inline kernelCAD script source."
},
"file": {
"type": "string",
"description": "Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"name": {
"type": "string",
"description": "Base file name (letters, digits, '.', '_', '-'). Default 'part'."
},
"scope": {
"enum": [
"part",
"bom",
"workshop"
],
"type": "string",
"description": "Default 'part' (a single-part pack). 'bom' packs the whole assembly's BOM. 'workshop' packs shop files plus cut list, DXF flats zip, and DFM warnings JSON."
},
"formats": {
"type": "array",
"items": {
"enum": [
"step",
"stl",
"3mf",
"pdf-drawing",
"bom-csv",
"dxf",
"cut-list-csv",
"cut-list-json",
"dfm-json",
"flats-zip"
],
"type": "string"
},
"description": "Files to include. Default step, stl, 3mf, pdf-drawing, bom-csv."
},
"processes": {
"type": "array",
"items": {
"enum": [
"3d-print",
"cnc",
"sheet-cut"
],
"type": "string"
},
"description": "Only return quote links for these processes. Default: all."
},
"tolerance": {
"type": "number",
"description": "Requested absolute mesh tolerance in mm. This runtime currently returns export.mesh.tolerance-unsupported and writes no files when this is supplied."
},
"output_dir": {
"type": "string",
"description": "Directory to write the pack into (created if missing). Hosted server: only the directory name is used; the pack is written in a server-owned directory and returned as download links."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Build Fabrication Pack",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}
}Use this when you need a manufacturability (DFM) report before printing, machining, bending (sheet metal) or injection molding a part: returns a three-state checklist, no dfmSpec(...) needed. Pass { file | code } and optional processes: 'fdm' | 'cnc' | 'sheet-metal' | 'injection-molding' (default ['fdm', 'cnc']). FDM 3D printing checks: fdm.overhangs (unsupported overhang steeper than max_overhang_deg, default 45° from vertical), fdm.bridging (bridges over max_bridge_mm, default 10), fdm.min-wall (walls under 2 × nozzle_mm, default 0.4 mm nozzle), fdm.min-hole (holes under 5 × nozzle), fdm.min-pin (warn), fdm.bed-fit (printer profile bed, default generic-fdm), fdm.bed-contact (warn). CNC 3-axis milling checks: cnc.undercuts (surface unreachable from approach_axes, default ['+z']; list several axes for several setups) and cnc.internal-corner-radius (sharp internal corners and fillets smaller than the end-mill radius, tool_diameter_mm default 6). Sheet-metal checks (sheetMetal(...).bend(...) parts; thickness read from the model; a non-sheet part returns sheet.not-sheet-metal as not-checked) on the flat pattern: sheet.min-bend-radius (inner radius ≥ min_bend_radius_ratio × t, default 1), sheet.hole-to-bend (hole edge to bend line ≥ hole_to_bend_thicknesses × t + R, default 2.5), sheet.hole-to-edge (≥ hole_to_edge_thicknesses × t, default 2), sheet.min-flange (outside of bend to edge ≥ min_flange_thicknesses × t, default 4). Injection-molding checks (the dfmSpec({ process: 'moulding' }) engine; two-part mold opening along ±pull_direction, default '+z'): mold.draft (faces with less than min_draft_deg draft, default 1°; face refs are optional when unique lineage is available), mold.wall-thickness (fail under min_wall_mm, default 1; warn over max_wall_mm, default 4, or when thickest/thinnest > max_wall_ratio, default 2.5), mold.undercuts (faces neither mold half releases), mold.sharp-internal-corners (warn: creases and fillets under min_radius_mm, default 0.5); an unmeasured required rule is not-checked. Returns { ok, verdict?: 'pass'|'fail'|'not-checked', checks: [{ id (rule key), process, part, source, status: 'pass'|'fail'|'warn'|'not-checked', summary, value?, limit?, unit?, op?, tolerance?, refs? }] }. Tolerance is in the same unit as value and limit, defaults to zero, and is inclusive: for >=, pass when value + tolerance >= limit; for <=, pass when value - tolerance <= limit. Face refs are omitted when unique resolvable lineage is unavailable. Also returns fdm?, cnc?, sheetMetal?, injectionMolding?, diagnostics. `ok` reports successful invocation/model evaluation/process execution, not manufacturability: checked findings can fail while `ok` is true. Argument or model-evaluation errors return `ok: false` without a verdict; a completed review can be `not-checked` while `ok` is true. Settings from the script's dfmSpec({ process: 'fdm' | 'moulding' }) are used as defaults; call options win. For the script-declared gates (clearance, voids, channels) use verify({ check: 'dfm' }).
| Parameter | Type | Description |
|---|---|---|
| code | string | Inline kernelCAD script source. |
| file | string | Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| printer | string | FDM printer profile id for the bed-fit check. Default 'generic-fdm'. |
| nozzle_mm | number | FDM nozzle diameter, mm. Default 0.4. |
| processes | array | Processes to review. Default ['fdm', 'cnc']. |
| max_wall_mm | number | Injection molding: thickest allowed section, mm. Default 4. |
| min_wall_mm | number | Injection molding: thinnest allowed wall, mm. Default 1. |
| approach_axes | array | CNC tool approach directions, one per setup (the tool comes from that side). Default ['+z']. |
| max_bridge_mm | number | FDM longest unsupported bridge, mm. Default 10. |
| min_draft_deg | number | Injection molding: minimum draft angle to the pull direction, degrees. Default 1. |
| min_radius_mm | number | Injection molding: smallest internal corner radius before mold.sharp-internal-corners warns, mm. Default 0.5. |
| max_wall_ratio | number |
{
"name": "dfm_review",
"title": "Review Manufacturability",
"description": "Use this when you need a manufacturability (DFM) report before printing, machining, bending (sheet metal) or injection molding a part: returns a three-state checklist, no dfmSpec(...) needed. Pass { file | code } and optional processes: 'fdm' | 'cnc' | 'sheet-metal' | 'injection-molding' (default ['fdm', 'cnc']). FDM 3D printing checks: fdm.overhangs (unsupported overhang steeper than max_overhang_deg, default 45° from vertical), fdm.bridging (bridges over max_bridge_mm, default 10), fdm.min-wall (walls under 2 × nozzle_mm, default 0.4 mm nozzle), fdm.min-hole (holes under 5 × nozzle), fdm.min-pin (warn), fdm.bed-fit (printer profile bed, default generic-fdm), fdm.bed-contact (warn). CNC 3-axis milling checks: cnc.undercuts (surface unreachable from approach_axes, default ['+z']; list several axes for several setups) and cnc.internal-corner-radius (sharp internal corners and fillets smaller than the end-mill radius, tool_diameter_mm default 6). Sheet-metal checks (sheetMetal(...).bend(...) parts; thickness read from the model; a non-sheet part returns sheet.not-sheet-metal as not-checked) on the flat pattern: sheet.min-bend-radius (inner radius ≥ min_bend_radius_ratio × t, default 1), sheet.hole-to-bend (hole edge to bend line ≥ hole_to_bend_thicknesses × t + R, default 2.5), sheet.hole-to-edge (≥ hole_to_edge_thicknesses × t, default 2), sheet.min-flange (outside of bend to edge ≥ min_flange_thicknesses × t, default 4). Injection-molding checks (the dfmSpec({ process: 'moulding' }) engine; two-part mold opening along ±pull_direction, default '+z'): mold.draft (faces with less than min_draft_deg draft, default 1°; face refs are optional when unique lineage is available), mold.wall-thickness (fail under min_wall_mm, default 1; warn over max_wall_mm, default 4, or when thickest/thinnest > max_wall_ratio, default 2.5), mold.undercuts (faces neither mold half releases), mold.sharp-internal-corners (warn: creases and fillets under min_radius_mm, default 0.5); an unmeasured required rule is not-checked. Returns { ok, verdict?: 'pass'|'fail'|'not-checked', checks: [{ id (rule key), process, part, source, status: 'pass'|'fail'|'warn'|'not-checked', summary, value?, limit?, unit?, op?, tolerance?, refs? }] }. Tolerance is in the same unit as value and limit, defaults to zero, and is inclusive: for >=, pass when value + tolerance >= limit; for <=, pass when value - tolerance <= limit. Face refs are omitted when unique resolvable lineage is unavailable. Also returns fdm?, cnc?, sheetMetal?, injectionMolding?, diagnostics. `ok` reports successful invocation/model evaluation/process execution, not manufacturability: checked findings can fail while `ok` is true. Argument or model-evaluation errors return `ok: false` without a verdict; a completed review can be `not-checked` while `ok` is true. Settings from the script's dfmSpec({ process: 'fdm' | 'moulding' }) are used as defaults; call options win. For the script-declared gates (clearance, voids, channels) use verify({ check: 'dfm' }).",
"inputSchema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Inline kernelCAD script source."
},
"file": {
"type": "string",
"description": "Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"printer": {
"enum": [
"generic-fdm",
"bambu-a1-mini",
"bambu-a1",
"bambu-p1s",
"bambu-p1p",
"bambu-x1c",
"bambu-x1e",
"bambu-h2d",
"bambu-h2s",
"prusa-mini-plus",
"prusa-mk4s",
"prusa-core-one",
"prusa-xl",
"creality-ender-3-v3",
"creality-k1",
"creality-k1-max",
"creality-k2-plus",
"elegoo-neptune-4-pro",
"anycubic-kobra-3",
"voron-2.4-250",
"voron-2.4-300",
"voron-2.4-350",
"ultimaker-s5"
],
"type": "string",
"description": "FDM printer profile id for the bed-fit check. Default 'generic-fdm'."
},
"nozzle_mm": {
"type": "number",
"description": "FDM nozzle diameter, mm. Default 0.4."
},
"processes": {
"type": "array",
"items": {
"enum": [
"fdm",
"cnc",
"sheet-metal",
"injection-molding"
],
"type": "string"
},
"description": "Processes to review. Default ['fdm', 'cnc']."
},
"max_wall_mm": {
"type": "number",
"description": "Injection molding: thickest allowed section, mm. Default 4."
},
"min_wall_mm": {
"type": "number",
"description": "Injection molding: thinnest allowed wall, mm. Default 1."
},
"approach_axes": {
"type": "array",
"items": {
"enum": [
"+x",
"-x",
"+y",
"-y",
"+z",
"-z"
],
"type": "string"
},
"description": "CNC tool approach directions, one per setup (the tool comes from that side). Default ['+z']."
},
"max_bridge_mm": {
"type": "number",
"description": "FDM longest unsupported bridge, mm. Default 10."
},
"min_draft_deg": {
"type": "number",
"description": "Injection molding: minimum draft angle to the pull direction, degrees. Default 1."
},
"min_radius_mm": {
"type": "number",
"description": "Injection molding: smallest internal corner radius before mold.sharp-internal-corners warns, mm. Default 0.5."
},
"max_wall_ratio": {
"type": "number",
"description": "Injection molding: thickest / thinnest wall above this warns (non-uniform walls warp and sink). Default 2.5."
},
"pull_direction": {
"enum": [
"+x",
"-x",
"+y",
"-y",
"+z",
"-z"
],
"type": "string",
"description": "Injection molding: part-local mold-opening axis (the two halves separate along ±this). Default '+z'."
},
"build_direction": {
"enum": [
"+x",
"-x",
"+y",
"-y",
"+z",
"-z"
],
"type": "string",
"description": "FDM part-local axis pointing up from the bed. Default '+z'."
},
"max_overhang_deg": {
"type": "number",
"description": "FDM steepest printable overhang, degrees from vertical (0 = wall, 90 = flat ceiling). Default 45."
},
"tool_diameter_mm": {
"type": "number",
"description": "CNC end-mill diameter, mm. Default 6."
},
"max_undercut_area_mm2": {
"type": "number",
"description": "CNC unreachable area tolerated before cnc.undercuts fails, mm². Default 1."
},
"min_bend_radius_ratio": {
"type": "number",
"description": "Sheet metal: inner bend radius must be ≥ this × thickness. Default 1."
},
"min_flange_thicknesses": {
"type": "number",
"description": "Sheet metal: flange length from the outside of the bend must be ≥ this × thickness. Default 4."
},
"hole_to_bend_thicknesses": {
"type": "number",
"description": "Sheet metal: hole edge to bend line must be ≥ this × thickness + bend radius. Default 2.5."
},
"hole_to_edge_thicknesses": {
"type": "number",
"description": "Sheet metal: hole edge to blank edge must be ≥ this × thickness. Default 2."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Review Manufacturability",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need the faces a ray hits in a local Studio model, nearest first, with points, distances, and normals. Inputs are model units (mm); direction is normalized. Requires the local Studio URL and session token for the same script, reads the current model generation, and returns a set_selection argument object with every hit. feature_id must identify a displayed terminal shape; intermediates have no current viewer shapeIndex. Intersections use the viewer per-face tessellation, so curved-surface points and normals are mesh approximations.
| Parameter | Type | Description |
|---|---|---|
| code | string | Inline kernelCAD script source. |
| file | string | Path to a .kcad.ts script. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| origin * | array | Ray origin [x, y, z] in model units. |
| session * | string | Studio sessionToken for this script, from GET /__kernelcad/session?script=<path>. |
| direction * | array | Nonzero ray direction [x, y, z]; normalized internally. |
| feature_id | string | Displayed terminal feature to ray-pick; defaults to the returned feature. Intermediate features are not available as current viewer selections. |
| studio_url * | string | Local Studio HTTP origin, e.g. http://localhost:5173. |
{
"name": "ray_pick",
"title": "Pick Point by Ray",
"description": "Use this when you need the faces a ray hits in a local Studio model, nearest first, with points, distances, and normals. Inputs are model units (mm); direction is normalized. Requires the local Studio URL and session token for the same script, reads the current model generation, and returns a set_selection argument object with every hit. feature_id must identify a displayed terminal shape; intermediates have no current viewer shapeIndex. Intersections use the viewer per-face tessellation, so curved-surface points and normals are mesh approximations.",
"inputSchema": {
"type": "object",
"allOf": [
{
"oneOf": [
{
"not": {
"required": [
"code"
]
},
"required": [
"file"
]
},
{
"not": {
"required": [
"file"
]
},
"required": [
"code"
]
}
]
}
],
"required": [
"origin",
"direction",
"studio_url",
"session"
],
"properties": {
"code": {
"type": "string",
"description": "Inline kernelCAD script source."
},
"file": {
"type": "string",
"description": "Path to a .kcad.ts script. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"origin": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "Ray origin [x, y, z] in model units."
},
"session": {
"type": "string",
"minLength": 1,
"description": "Studio sessionToken for this script, from GET /__kernelcad/session?script=<path>."
},
"direction": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "Nonzero ray direction [x, y, z]; normalized internally."
},
"feature_id": {
"type": "string",
"description": "Displayed terminal feature to ray-pick; defaults to the returned feature. Intermediate features are not available as current viewer selections."
},
"studio_url": {
"type": "string",
"description": "Local Studio HTTP origin, e.g. http://localhost:5173."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Pick Point by Ray",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Evaluate supplied kernelCAD code or a file to capture an authored NURBS curve (nurbsCurve/spline3d). Returns degree, distinct knots and multiplicities, poles, weights, rational and uniformWeights flags, hasNonUnitWeights, and parameter range. Defaults to the last captured curve in that script; pass feature_id to choose one. The source may load referenced assets. Reports authored curve data, not exact geometry-derived B-rep edge/face NURBS; surface extraction and blending are not supported. Does not update the active MCP session or write a project.
| Parameter | Type | Description |
|---|---|---|
| code | string | Inline kernelCAD script source. |
| file | string | Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. |
| feature_id | string | Optional curve3d FeatureId; defaults to the last captured NURBS curve. |
{
"name": "inspect_nurbs",
"title": "Inspect NURBS Curve",
"description": "Evaluate supplied kernelCAD code or a file to capture an authored NURBS curve (nurbsCurve/spline3d). Returns degree, distinct knots and multiplicities, poles, weights, rational and uniformWeights flags, hasNonUnitWeights, and parameter range. Defaults to the last captured curve in that script; pass feature_id to choose one. The source may load referenced assets. Reports authored curve data, not exact geometry-derived B-rep edge/face NURBS; surface extraction and blending are not supported. Does not update the active MCP session or write a project.",
"inputSchema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Inline kernelCAD script source."
},
"file": {
"type": "string",
"description": "Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
},
"feature_id": {
"type": "string",
"description": "Optional curve3d FeatureId; defaults to the last captured NURBS curve."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Inspect NURBS Curve",
"readOnlyHint": true,
"openWorldHint": true,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need to fit an orthogonal least-squares plane to XYZ point-cloud data. Returns centroid, deterministic unit normal, signed point residuals, RMS residual and maximum absolute residual. Accepts points already parsed by the caller from scan data or mesh vertices. Computes parameters only; it does not create a surface body. Requires at least three non-collinear finite points.
| Parameter | Type | Description |
|---|---|---|
| points * | array | Point cloud as [x, y, z] coordinate triples in model units. |
{
"name": "fit_plane",
"title": "Fit Plane to Points",
"description": "Use this when you need to fit an orthogonal least-squares plane to XYZ point-cloud data. Returns centroid, deterministic unit normal, signed point residuals, RMS residual and maximum absolute residual. Accepts points already parsed by the caller from scan data or mesh vertices. Computes parameters only; it does not create a surface body. Requires at least three non-collinear finite points.",
"inputSchema": {
"type": "object",
"required": [
"points"
],
"properties": {
"points": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
},
"maxItems": 100000,
"minItems": 3,
"description": "Point cloud as [x, y, z] coordinate triples in model units."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Fit Plane to Points",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when the user wants to union, subtract, or intersect two imported triangle mesh solids (STL, OBJ, or 3MF). Supports union, subtract (A minus B) and intersect. Pass each operand as { file } on the MCP server or { data } with base64 mesh bytes; formats are detected or may be specified. Returns volume in mm³, triangle count and a binary STL as data_base64; pass that payload to import_step to continue modeling. Inputs must be closed, consistently oriented 2-manifold meshes. Open, non-manifold, or invalid meshes return an error. This computes mesh geometry and does not create an editable B-rep feature tree.
| Parameter | Type | Description |
|---|---|---|
| a * | object | First mesh: { file } or { data } base64, optional format stl|obj|3mf. |
| b * | object | Second mesh: { file } or { data } base64, optional format stl|obj|3mf. |
| operation * | string | one of ["union","subtract","intersect"] |
| tolerance_mm | number | Vertex weld tolerance in mm. Default 0.000001. |
| max_triangles | integer | Maximum triangles per input and output. Default and maximum 100000. |
{
"name": "mesh_boolean",
"title": "Combine Meshes (Boolean)",
"description": "Use this when the user wants to union, subtract, or intersect two imported triangle mesh solids (STL, OBJ, or 3MF). Supports union, subtract (A minus B) and intersect. Pass each operand as { file } on the MCP server or { data } with base64 mesh bytes; formats are detected or may be specified. Returns volume in mm³, triangle count and a binary STL as data_base64; pass that payload to import_step to continue modeling. Inputs must be closed, consistently oriented 2-manifold meshes. Open, non-manifold, or invalid meshes return an error. This computes mesh geometry and does not create an editable B-rep feature tree.",
"inputSchema": {
"type": "object",
"required": [
"operation",
"a",
"b"
],
"properties": {
"a": {
"type": "object",
"description": "First mesh: { file } or { data } base64, optional format stl|obj|3mf."
},
"b": {
"type": "object",
"description": "Second mesh: { file } or { data } base64, optional format stl|obj|3mf."
},
"operation": {
"enum": [
"union",
"subtract",
"intersect"
],
"type": "string"
},
"tolerance_mm": {
"type": "number",
"description": "Vertex weld tolerance in mm. Default 0.000001."
},
"max_triangles": {
"type": "integer",
"description": "Maximum triangles per input and output. Default and maximum 100000."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Combine Meshes (Boolean)",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this when you need an ordered exploded-view plan for an assembly. Supply parts as {name,center:[x,y,z],size:[x,y,z]} in mm. Optional assembly_order sets the sequence; missing order falls back to input part order, and unlisted/unknown order refs are reported. Choose mode axis (default) or radial; axis follows the requested direction, radial moves parts away from the assembly centroid. The result includes ready-to-paste param_declarations, animation_tracks and reverse_animation_tracks for animationView(), part_transforms for existing shapes, and script_fragment. cameraPlan gives framing guidance.
| Parameter | Type | Description |
|---|---|---|
| axis | array | Assembly direction; default +Z. |
| mode | string | Explode direction strategy; default axis. |
| parts | array | Named assembly parts and measured bbox centers/sizes in mm. |
| spacing | number | Positive spacing scale; default 1.25. |
| duration_ms | integer | Timeline duration from 500 to 60000 ms; default 3000. |
| assembly_order | array |
{
"name": "explode_view",
"title": "Plan Exploded View",
"description": "Use this when you need an ordered exploded-view plan for an assembly. Supply parts as {name,center:[x,y,z],size:[x,y,z]} in mm. Optional assembly_order sets the sequence; missing order falls back to input part order, and unlisted/unknown order refs are reported. Choose mode axis (default) or radial; axis follows the requested direction, radial moves parts away from the assembly centroid. The result includes ready-to-paste param_declarations, animation_tracks and reverse_animation_tracks for animationView(), part_transforms for existing shapes, and script_fragment. cameraPlan gives framing guidance.",
"inputSchema": {
"type": "object",
"properties": {
"axis": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "Assembly direction; default +Z."
},
"mode": {
"enum": [
"axis",
"radial"
],
"type": "string",
"description": "Explode direction strategy; default axis."
},
"parts": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"center",
"size"
],
"properties": {
"name": {
"type": "string"
},
"size": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
},
"center": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
}
},
"additionalProperties": false
},
"description": "Named assembly parts and measured bbox centers/sizes in mm."
},
"spacing": {
"type": "number",
"description": "Positive spacing scale; default 1.25."
},
"duration_ms": {
"type": "integer",
"description": "Timeline duration from 500 to 60000 ms; default 3000."
},
"assembly_order": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Plan Exploded View",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this to author and evaluate a fillet or chamfer on a kernelCAD Shape. It inserts Shape.fillet(radius, selector, { continuity: G1 }), Shape.fillet({ start, end }, selector, { continuity }), or Shape.chamfer(distance, selector), then returns the patched source and evaluation diagnostics. Constant-radius OCCT fillets expose measured G1 only; G2, G3, and G4 are refused because their support seams remained G1 in the tested mode/tolerance sweep. A linear two-station radius_profile uses the NURBS constrained route on one selected edge and reports its measured result; the planar fixture measured G2, while requests above or outside measured support pairs can downgrade with feature.fillet.continuity-not-applicable. Selectors accept EdgeSelector syntax, including stable edge refs from get_selection (for example @kc[box_1/edge/s<hash>]), arrays of selected edge refs, query strings, EdgeQuery objects, or { face: canonical name, face label, or face query }. This authors a blend operation but does not extract blend-surface NURBS poles.
| Parameter | Type | Description |
|---|---|---|
| code * | string | Inline .kcad.ts source. |
| radius | number | Fillet radius in mm; required for operation:'fillet'. |
| distance | number | Chamfer distance in mm; required for operation:'chamfer'. |
| selector | any | Optional EdgeSelector: a stable @kc[...] edge ref from get_selection, an array of selected edge refs, an edge query string, an EdgeQuery object such as { parallel: "X", atY: 10 }, or { face: canonical face name, face label, or FaceQuery descriptor }. Higher-order blend requests require one selected … |
| operation | string | Operation; defaults to 'fillet'. |
| continuity | string | Requested fillet continuity; defaults to G1. Constant-radius fillets accept G1 only. With radius_profile, the achieved class is measured and any downgrade is reported. Chamfer rejects this field. |
| shape_binding * | string | Existing Shape variable name to blend. |
| radius_profile | object | Optional linear start/end radius profile along one selected fillet edge. When supplied, radius is not required. |
{
"name": "apply_surface_blend",
"title": "Apply Fillet or Chamfer Blend",
"description": "Use this to author and evaluate a fillet or chamfer on a kernelCAD Shape. It inserts Shape.fillet(radius, selector, { continuity: G1 }), Shape.fillet({ start, end }, selector, { continuity }), or Shape.chamfer(distance, selector), then returns the patched source and evaluation diagnostics. Constant-radius OCCT fillets expose measured G1 only; G2, G3, and G4 are refused because their support seams remained G1 in the tested mode/tolerance sweep. A linear two-station radius_profile uses the NURBS constrained route on one selected edge and reports its measured result; the planar fixture measured G2, while requests above or outside measured support pairs can downgrade with feature.fillet.continuity-not-applicable. Selectors accept EdgeSelector syntax, including stable edge refs from get_selection (for example @kc[box_1/edge/s<hash>]), arrays of selected edge refs, query strings, EdgeQuery objects, or { face: canonical name, face label, or face query }. This authors a blend operation but does not extract blend-surface NURBS poles.",
"inputSchema": {
"type": "object",
"required": [
"code",
"shape_binding"
],
"properties": {
"code": {
"type": "string",
"description": "Inline .kcad.ts source."
},
"radius": {
"type": "number",
"description": "Fillet radius in mm; required for operation:'fillet'.",
"exclusiveMinimum": 0
},
"distance": {
"type": "number",
"description": "Chamfer distance in mm; required for operation:'chamfer'.",
"exclusiveMinimum": 0
},
"selector": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
},
{
"type": "object",
"additionalProperties": true
}
],
"description": "Optional EdgeSelector: a stable @kc[...] edge ref from get_selection, an array of selected edge refs, an edge query string, an EdgeQuery object such as { parallel: \"X\", atY: 10 }, or { face: canonical face name, face label, or FaceQuery descriptor }. Higher-order blend requests require one selected edge."
},
"operation": {
"enum": [
"fillet",
"chamfer"
],
"type": "string",
"description": "Operation; defaults to 'fillet'."
},
"continuity": {
"enum": [
"G1",
"G2",
"G3",
"G4"
],
"type": "string",
"description": "Requested fillet continuity; defaults to G1. Constant-radius fillets accept G1 only. With radius_profile, the achieved class is measured and any downgrade is reported. Chamfer rejects this field."
},
"shape_binding": {
"type": "string",
"description": "Existing Shape variable name to blend."
},
"radius_profile": {
"type": "object",
"required": [
"start",
"end"
],
"properties": {
"end": {
"type": "number",
"exclusiveMinimum": 0
},
"start": {
"type": "number",
"exclusiveMinimum": 0
}
},
"description": "Optional linear start/end radius profile along one selected fillet edge. When supplied, radius is not required.",
"additionalProperties": false
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Apply Fillet or Chamfer Blend",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Use this to merge a supplied handoff BOM with optional KernelCAD catalog parts, MPNs and pricing, write a local CSV, and return Sheets-ready rows. Pass exactly one of handoff, handoff_json or handoff_path. The default output is a new file under artifacts/bom; an explicit output_path selects another allowed destination. Existing files are preserved unless overwrite:true, which replaces the destination. This tool makes no Google API calls.
| Parameter | Type | Description |
|---|---|---|
| handoff | object | BOM handoff object. Supply exactly one handoff source. |
| overwrite | boolean | Set true to replace an existing CSV destination. Existing files are otherwise preserved. |
| output_path | string | Optional CSV destination. Defaults to artifacts/bom/bom-<id>.csv. |
| handoff_json | string | JSON text containing a handoff object with parts; use instead of handoff or handoff_path. |
| handoff_path | string | Path to a handoff JSON file; use instead of handoff or handoff_json. |
| catalog_parts | array | Optional catalog entries matched by ref or catalog id; unmatched entries become additional rows. |
{
"name": "write_bom",
"title": "Write Bill of Materials",
"description": "Use this to merge a supplied handoff BOM with optional KernelCAD catalog parts, MPNs and pricing, write a local CSV, and return Sheets-ready rows. Pass exactly one of handoff, handoff_json or handoff_path. The default output is a new file under artifacts/bom; an explicit output_path selects another allowed destination. Existing files are preserved unless overwrite:true, which replaces the destination. This tool makes no Google API calls.",
"inputSchema": {
"type": "object",
"allOf": [
{
"oneOf": [
{
"required": [
"handoff"
]
},
{
"required": [
"handoff_json"
]
},
{
"required": [
"handoff_path"
]
}
]
}
],
"properties": {
"handoff": {
"type": "object",
"required": [
"parts"
],
"properties": {
"parts": {
"type": "array",
"items": {
"type": "object",
"required": [
"ref"
],
"properties": {
"mpn": {
"anyOf": [
{
"type": [
"string",
"null"
]
},
{
"type": "object",
"properties": {
"value": {
"type": [
"string",
"null"
]
},
"source": {
"type": [
"string",
"null"
]
},
"status": {
"type": [
"string",
"null"
]
}
}
}
]
},
"qty": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": 1
},
"ref": {
"type": "string",
"pattern": "\\S",
"description": "Non-empty part reference, e.g. R1."
},
"name": {
"type": [
"string",
"null"
]
},
"part": {
"type": [
"string",
"null"
]
},
"notes": {
"type": [
"string",
"null"
]
},
"source": {
"type": [
"string",
"null"
]
},
"quantity": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": 1
},
"catalog_id": {
"type": [
"string",
"null"
]
}
}
}
}
},
"description": "BOM handoff object. Supply exactly one handoff source."
},
"overwrite": {
"type": "boolean",
"description": "Set true to replace an existing CSV destination. Existing files are otherwise preserved."
},
"output_path": {
"type": "string",
"description": "Optional CSV destination. Defaults to artifacts/bom/bom-<id>.csv."
},
"handoff_json": {
"type": "string",
"examples": [
"{\"parts\":[{\"ref\":\"R1\",\"quantity\":2}]}"
],
"minLength": 1,
"description": "JSON text containing a handoff object with parts; use instead of handoff or handoff_path."
},
"handoff_path": {
"type": "string",
"minLength": 1,
"description": "Path to a handoff JSON file; use instead of handoff or handoff_json."
},
"catalog_parts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": [
"string",
"null"
]
},
"qty": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": 1
},
"ref": {
"type": [
"string",
"null"
]
},
"name": {
"type": [
"string",
"null"
]
},
"notes": {
"type": [
"string",
"null"
]
},
"price": {
"anyOf": [
{
"type": "number",
"minimum": 0
},
{
"type": "null"
},
{
"type": "object",
"required": [
"amount"
],
"properties": {
"amount": {
"type": "number",
"minimum": 0
},
"currency": {
"type": [
"string",
"null"
]
}
}
}
]
},
"source": {
"type": [
"string",
"null"
]
},
"vendor": {
"type": [
"string",
"null"
]
},
"currency": {
"type": [
"string",
"null"
]
},
"partNumber": {
"type": [
"string",
"null"
]
}
}
},
"description": "Optional catalog entries matched by ref or catalog id; unmatched entries become additional rows."
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Write Bill of Materials",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": true
}
}Use this when you have a list of parts with bounding boxes and positions (from a layout, spreadsheet, another tool or a sketch) and need an evaluable placeholder assembly script. Pass parts as { name, bbox_mm:[x,y,z], position_mm:[x,y,z], rotation_deg?, anchors? } in mm; position_mm locates the bbox lower corner and anchors are named points in assembly coordinates. Optional connections [{ from, to }] reference anchors as "part.anchor" (including built-ins origin, bbox_center, bbox_x_min..bbox_z_max) and become fastened mates that express connectivity intent only; no wire or route geometry is generated. Returns the script (corner-anchored box solids with named connectors) plus warnings. It reads no files and cuts nothing; refine the solids with add_part/add_feature afterwards.
| Parameter | Type | Description |
|---|---|---|
| name | string | Assembly name, default "blockout". |
| parts * | array | |
| connections | array |
{
"name": "blockout_assembly",
"title": "Block Out Assembly from Parts List",
"description": "Use this when you have a list of parts with bounding boxes and positions (from a layout, spreadsheet, another tool or a sketch) and need an evaluable placeholder assembly script. Pass parts as { name, bbox_mm:[x,y,z], position_mm:[x,y,z], rotation_deg?, anchors? } in mm; position_mm locates the bbox lower corner and anchors are named points in assembly coordinates. Optional connections [{ from, to }] reference anchors as \"part.anchor\" (including built-ins origin, bbox_center, bbox_x_min..bbox_z_max) and become fastened mates that express connectivity intent only; no wire or route geometry is generated. Returns the script (corner-anchored box solids with named connectors) plus warnings. It reads no files and cuts nothing; refine the solids with add_part/add_feature afterwards.",
"inputSchema": {
"type": "object",
"required": [
"parts"
],
"properties": {
"name": {
"type": "string",
"description": "Assembly name, default \"blockout\"."
},
"parts": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"bbox_mm",
"position_mm"
],
"properties": {
"name": {
"type": "string"
},
"anchors": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"position_mm"
],
"properties": {
"name": {
"type": "string"
},
"position_mm": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "Anchor point in assembly coordinates, mm."
}
},
"additionalProperties": false
}
},
"bbox_mm": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "Box dimensions [x,y,z] in mm."
},
"position_mm": {
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3,
"description": "Bbox lower corner in assembly coordinates, mm."
},
"rotation_deg": {
"anyOf": [
{
"type": "number"
},
{
"type": "array",
"items": {
"type": "number"
},
"maxItems": 3,
"minItems": 3
}
],
"description": "Rotation about Z as a number, or XYZ Euler degrees as [x,y,z]."
}
},
"additionalProperties": false
},
"minItems": 1
},
"connections": {
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"to": {
"type": "string",
"description": "\"part.anchor\""
},
"from": {
"type": "string",
"description": "\"part.anchor\""
}
},
"additionalProperties": false
}
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Block Out Assembly from Parts List",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Start or read the real price for making the part. Cheap. Returns status "ready" with estimate_cents and summary, or "pricing" while the makers are asked (call again in a few seconds). Creates nothing and charges nothing.
| Parameter | Type | Description |
|---|---|---|
| slug | string | Saved project slug (from open_in_studio or a /p/<slug> link). Send slug or source, not both. |
| method | object | How the part should be made. Propose it from the user's words and the part (flat sheet: laser_cut or sheetmetal; metal block: cnc; plastic: fdm_print or resin_print). |
| source | string | The kernelCAD script, when the part is not saved. Send slug or source, not both. |
{
"name": "price_part",
"title": "Price Part",
"description": "Start or read the real price for making the part. Cheap. Returns status \"ready\" with estimate_cents and summary, or \"pricing\" while the makers are asked (call again in a few seconds). Creates nothing and charges nothing.",
"inputSchema": {
"type": "object",
"properties": {
"slug": {
"type": "string",
"description": "Saved project slug (from open_in_studio or a /p/<slug> link). Send slug or source, not both."
},
"method": {
"type": "object",
"required": [
"process"
],
"properties": {
"reason": {
"type": "string",
"description": "One line: why this method."
},
"process": {
"enum": [
"laser_cut",
"sheetmetal",
"cnc",
"fdm_print",
"resin_print"
],
"type": "string"
},
"material": {
"type": "string",
"description": "Only a material the user named."
},
"quantity": {
"type": "integer",
"maximum": 10000,
"minimum": 1
}
},
"description": "How the part should be made. Propose it from the user's words and the part (flat sheet: laser_cut or sheetmetal; metal block: cnc; plastic: fdm_print or resin_print).",
"additionalProperties": false
},
"source": {
"type": "string",
"description": "The kernelCAD script, when the part is not saved. Send slug or source, not both."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Price Part",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}Order the part made: creates the production request and returns a pay_url for the user. Propose the manufacturing method from the user's words and the part, pass it as method with a one-line reason. The price is the real maker price; never invent or send one. Tell the user the card is only held, and a person confirms the final price before charging. If the result is status "pricing", the price is still being worked out: call again in a few seconds.
| Parameter | Type | Description |
|---|---|---|
| slug | string | Saved project slug (from open_in_studio or a /p/<slug> link). Send slug or source, not both. |
| method | object | How the part should be made. Propose it from the user's words and the part (flat sheet: laser_cut or sheetmetal; metal block: cnc; plastic: fdm_print or resin_print). |
| source | string | The kernelCAD script, when the part is not saved. Send slug or source, not both. |
{
"name": "order_part",
"title": "Order Part",
"description": "Order the part made: creates the production request and returns a pay_url for the user. Propose the manufacturing method from the user's words and the part, pass it as method with a one-line reason. The price is the real maker price; never invent or send one. Tell the user the card is only held, and a person confirms the final price before charging. If the result is status \"pricing\", the price is still being worked out: call again in a few seconds.",
"inputSchema": {
"type": "object",
"properties": {
"slug": {
"type": "string",
"description": "Saved project slug (from open_in_studio or a /p/<slug> link). Send slug or source, not both."
},
"method": {
"type": "object",
"required": [
"process"
],
"properties": {
"reason": {
"type": "string",
"description": "One line: why this method."
},
"process": {
"enum": [
"laser_cut",
"sheetmetal",
"cnc",
"fdm_print",
"resin_print"
],
"type": "string"
},
"material": {
"type": "string",
"description": "Only a material the user named."
},
"quantity": {
"type": "integer",
"maximum": 10000,
"minimum": 1
}
},
"description": "How the part should be made. Propose it from the user's words and the part (flat sheet: laser_cut or sheetmetal; metal block: cnc; plastic: fdm_print or resin_print).",
"additionalProperties": false
},
"source": {
"type": "string",
"description": "The kernelCAD script, when the part is not saved. Send slug or source, not both."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Order Part",
"readOnlyHint": false,
"openWorldHint": true,
"destructiveHint": false
}
}Prepare an indicative estimate and durable manufacturing checklist for a whole CAD assembly, including mixed materials and processes. The server reads material and sheet thickness from CAD, multiplies BOM quantities by batchQuantity, selects supported processes, checks live supplier offers, and reports any missing prices or blockers. This creates only a draft estimate. It does not send an order, charge the customer, or start checkout. Sign in to estimate private saved projects; source code and public projects can be estimated as a guest.
| Parameter | Type | Description |
|---|---|---|
| params | object | Current CAD parameter values. Materials and sheet thickness come from the CAD design. |
| source | string | Current kernelCAD source for an unsaved assembly. |
| assembly | string | Assembly name when the script contains multiple assemblies. |
| projectSlug | string | Saved project slug. Use this for a saved assembly. |
| batchQuantity | integer | Number of complete identical assemblies to manufacture. Multiplies every BOM row; does not alter the geometry. |
| projectVersion | integer | Immutable saved revision to estimate. |
{
"name": "estimate_assembly_manufacturing",
"title": "estimate_assembly_manufacturing",
"description": "Prepare an indicative estimate and durable manufacturing checklist for a whole CAD assembly, including mixed materials and processes. The server reads material and sheet thickness from CAD, multiplies BOM quantities by batchQuantity, selects supported processes, checks live supplier offers, and reports any missing prices or blockers. This creates only a draft estimate. It does not send an order, charge the customer, or start checkout. Sign in to estimate private saved projects; source code and public projects can be estimated as a guest.",
"inputSchema": {
"type": "object",
"anyOf": [
{
"required": [
"source"
]
},
{
"required": [
"projectSlug"
]
}
],
"properties": {
"params": {
"type": "object",
"description": "Current CAD parameter values. Materials and sheet thickness come from the CAD design.",
"additionalProperties": {
"anyOf": [
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "string"
}
]
}
},
"source": {
"type": "string",
"description": "Current kernelCAD source for an unsaved assembly."
},
"assembly": {
"type": "string",
"description": "Assembly name when the script contains multiple assemblies."
},
"projectSlug": {
"type": "string",
"description": "Saved project slug. Use this for a saved assembly."
},
"batchQuantity": {
"type": "integer",
"maximum": 1000,
"minimum": 1,
"description": "Number of complete identical assemblies to manufacture. Multiplies every BOM row; does not alter the geometry."
},
"projectVersion": {
"type": "integer",
"minimum": 1,
"description": "Immutable saved revision to estimate."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "estimate_assembly_manufacturing",
"readOnlyHint": false,
"openWorldHint": true,
"destructiveHint": false
}
}Submit a manufacturing quote request after the user has reviewed and explicitly approved the checklist and every displayed warning. KernelCAD staff will confirm the final itemized price. This sends the request for human review and does not charge the customer or start checkout.
| Parameter | Type | Description |
|---|---|---|
| email * | string | Contact email for the quote response. |
| params | object | Current CAD parameter values. Materials and sheet thickness come from the CAD design. |
| source | string | Current kernelCAD source for an unsaved assembly. |
| assembly | string | Assembly name when the script contains multiple assemblies. |
| checklist * | object | |
| requestId * | string | |
| accessToken | string | Guest access token returned by estimate_assembly_manufacturing; required when submitting as a guest. |
| projectSlug | string | Saved project slug. Use this for a saved assembly. |
| batchQuantity | integer | Number of complete identical assemblies to manufacture. Multiplies every BOM row; does not alter the geometry. |
| idempotencyKey * | string | |
| projectVersion | integer | Immutable saved revision to estimate. |
{
"name": "request_assembly_quote",
"title": "request_assembly_quote",
"description": "Submit a manufacturing quote request after the user has reviewed and explicitly approved the checklist and every displayed warning. KernelCAD staff will confirm the final itemized price. This sends the request for human review and does not charge the customer or start checkout.",
"inputSchema": {
"type": "object",
"required": [
"requestId",
"checklist",
"idempotencyKey",
"email"
],
"properties": {
"email": {
"type": "string",
"format": "email",
"description": "Contact email for the quote response."
},
"params": {
"type": "object",
"description": "Current CAD parameter values. Materials and sheet thickness come from the CAD design.",
"additionalProperties": {
"anyOf": [
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "string"
}
]
}
},
"source": {
"type": "string",
"description": "Current kernelCAD source for an unsaved assembly."
},
"assembly": {
"type": "string",
"description": "Assembly name when the script contains multiple assemblies."
},
"checklist": {
"type": "object",
"required": [
"approved",
"modelHash",
"snapshotHash",
"acknowledgedWarnings"
],
"properties": {
"approved": {
"type": "boolean",
"const": true,
"description": "Set true only after the user has reviewed and approved the checklist."
},
"modelHash": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"snapshotHash": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"acknowledgedWarnings": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"requestId": {
"type": "string",
"format": "uuid"
},
"accessToken": {
"type": "string",
"maxLength": 200,
"minLength": 32,
"description": "Guest access token returned by estimate_assembly_manufacturing; required when submitting as a guest."
},
"projectSlug": {
"type": "string",
"description": "Saved project slug. Use this for a saved assembly."
},
"batchQuantity": {
"type": "integer",
"maximum": 1000,
"minimum": 1,
"description": "Number of complete identical assemblies to manufacture. Multiplies every BOM row; does not alter the geometry."
},
"idempotencyKey": {
"type": "string",
"maxLength": 160,
"minLength": 1
},
"projectVersion": {
"type": "integer",
"minimum": 1,
"description": "Immutable saved revision to estimate."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "request_assembly_quote",
"readOnlyHint": false,
"openWorldHint": true,
"destructiveHint": false
}
}Plan one device across KernelCAD and LabWired. Read-only: returns companion tool names, project/revision links, the electronics-to-mechanics handoff, and a device review link for API clients. The viewer uses Order as its only purchase action. Use for robots, enclosures, PCB mounts or any hardware with electronics and mechanical parts. Optional slug resolves an accessible saved KernelCAD project; pass version to pin an immutable CAD revision, otherwise its current revision is used. Optional labwired_project/labwired_revision preserves its electronics reference. No purchase, payment, account linking, source upload or companion authorization is performed.
| Parameter | Type | Description |
|---|---|---|
| slug | string | Saved KernelCAD project slug; current revision is read with existing project permissions. |
| version | integer | Immutable KernelCAD revision to preserve. Requires slug; omitted means current revision. |
| labwired_pcb | string | LabWired PCB board id, including PCB-only handoffs. |
| labwired_share | string | LabWired share/lab id for an unsaved lab; use this or labwired_project. |
| labwired_project | string | LabWired project id returned by LabWired; a reference, not authorization. |
| labwired_revision | string | LabWired content hash/revision returned by LabWired. |
| labwired_pcb_revision | integer | PCB revision paired with labwired_pcb. |
{
"name": "hardware_pack",
"title": "Build with LabWired and KernelCAD",
"description": "Plan one device across KernelCAD and LabWired. Read-only: returns companion tool names, project/revision links, the electronics-to-mechanics handoff, and a device review link for API clients. The viewer uses Order as its only purchase action. Use for robots, enclosures, PCB mounts or any hardware with electronics and mechanical parts. Optional slug resolves an accessible saved KernelCAD project; pass version to pin an immutable CAD revision, otherwise its current revision is used. Optional labwired_project/labwired_revision preserves its electronics reference. No purchase, payment, account linking, source upload or companion authorization is performed.",
"inputSchema": {
"type": "object",
"properties": {
"slug": {
"type": "string",
"description": "Saved KernelCAD project slug; current revision is read with existing project permissions."
},
"version": {
"type": "integer",
"minimum": 1,
"description": "Immutable KernelCAD revision to preserve. Requires slug; omitted means current revision."
},
"labwired_pcb": {
"type": "string",
"description": "LabWired PCB board id, including PCB-only handoffs."
},
"labwired_share": {
"type": "string",
"description": "LabWired share/lab id for an unsaved lab; use this or labwired_project."
},
"labwired_project": {
"type": "string",
"description": "LabWired project id returned by LabWired; a reference, not authorization."
},
"labwired_revision": {
"type": "string",
"description": "LabWired content hash/revision returned by LabWired."
},
"labwired_pcb_revision": {
"type": "integer",
"minimum": 0,
"description": "PCB revision paired with labwired_pcb."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"additionalProperties": true
},
"annotations": {
"title": "Build with LabWired and KernelCAD",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}KernelCAD and LabWired work together as a hardware tool pack. Use KernelCAD for mechanical parts, enclosures, mounting, fit and manufacturing files; use LabWired for circuits, firmware, simulation and PCBs. When a device needs both, call hardware_pack to keep the project references and discover the companion workflow. For a new electronics design or a requested change, use LabWired labwired_hardware; pass project_id to continue an existing device. Use labwired_project_get for read-only inspection. For electronics-to-mechanics handoff, discover LabWired labwired_export and request format="kernelcad". It returns labwired-kernelcad-handoff/0.1 JSON, not CAD source. Read its millimetre board/part coordinates and source-tagged physical data, then author .kcad.ts, evaluate_script and open_in_studio with the existing project slug. Unknown bbox, mounting-hole and connector dimensions remain unknown; fetch a trusted part drawing or state the missing data before claiming fit. Do not substitute visual estimates. Carry the LabWired project/content hash and KernelCAD slug/version together; keep board outline, mounting holes, connector access, units and unverified dimensions explicit. Do not invent missing component dimensions or claim a geometry/simulation result proves a physical device. Use Order for the mechanical part. The returned device review link is available to API clients; electronic and mechanical purchases remain separate. A link does not authorize the companion plugin. Use the connected LabWired tools when available; otherwise give the returned companion link. Public MCP schemas: https://kernelcad.com/schema (JSON https://kernelcad.com/schema.json). Example library: https://kernelcad.com/examples. Modeling docs: https://kernelcad.com/docs/.
Names, descriptions and schemas were written by the server and are shown as data.
| cabin_bbox | object | Optional cabin AABB for likeness gate. |
| parameters | array | Optional list of the model's editable parameters, so Studio can render parameter controls. Each item is one control derived from the .kcad params. |
| attachments | array | Complementary project files referenced by relative path from the .kcad source. |
| new_project | boolean | 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. |
| require_stills | boolean | Forwarded to body-likeness gate (default true). |
| still_verdicts | array | Agent still checklist for likeness gate [{ code, passed, finding, view? }]. |
| continue_design | boolean | 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. |
| include_preview | boolean | 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. |
| expected_version | integer | Update only. The revision read before editing. Refuses the save if another writer changed it; read and reconcile the current revision before retrying. Requires project or slug and cannot be combined with new_project:true. |
| likeness_profile | string | 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. |
| show_electronics | boolean | Agent render decision. Default false. Set true to show Electronics in LabWired when relevant to the requested design, even before a PCB exists. Set false for mechanical-only models. Existing links never override this decision. |
| density | number | of:'mass' — material density in kg/m^3 (steel 7850, aluminium 2700, ABS 1050). Defaults to 1000 (water); the response echoes the value used and flags when it was defaulted. |
| assembly | string | of:'assembly'|'robot'|'bom' — assembly name; defaults to the first captured assembly. |
| category | string | of:'part-families' — optional top-level category to filter families by. |
| face_name | string | of:'face-edges' — canonical face name (required for that subject). |
| feature_id | string | of:'shape'|'mass'|'topology'|'edges'|'faces'|'face-edges'|'face-labels' — FeatureId; defaults to the last returned shape. |
| spike_factor | number | of:'curvature' — spike sensitivity as a multiple of the face's Gaussian stddev (default 6). |
| gyration_axis | object | of:'mass' — optional axis in shape-local mm to report the radius of gyration about. Omit for centroidal quantities only; the result is density-independent and returned in mm. |
| check:'edge-radius' — FaceQuery or @kc[...] face ref(s); includes incident edges and fillets on selected faces. |
| joint | string | check:'swept-collision' — joint to sweep; omit to sweep every declared joint. check:'joint-range' — revolute or prismatic joint to measure; omit to measure every one. check:'static-hold' — joint to evaluate; omit to evaluate every joint with a declared actuator. |
| loads | object | check:'load-capacity' — partName -> { force?: [Fx,Fy,Fz] N, torque?: [Tx,Ty,Tz] N*m }. |
| parts | array | check:'edge-radius' — explicit assembly part names (default all). |
| range | array | check:'swept-collision' — [lower, upper, step] in joint-native units. |
| study | string | check:'load-capacity' mode:'fea' — feaStudy name (default: the last declared one). |
| refine | boolean | check:'load-capacity' mode:'fea' — one automatic finer pass (0.75x element size) when the stress is untrusted, inside the element budget (default true); false solves once at the study's meshSize. |
| search | array | check:'joint-range' — [min, max] search window in the joint's units. Overrides authored limits. A joint with no finite window is unknown, not clear. |
| vendor | string | check:'dfm-preflight' — vendor SKU (required for that check). |
| gravity | array | check:'static-hold' — gravity vector, m/s^2, world frame (default [0, 0, -9.81]). check:'assembly-path' with stability:true — gravity direction, world frame, magnitude ignored (default [0, 0, -1]). |
| service | string | check:'dfm-preflight' — service. |
| assembly | string | Assembly name; defaults to the first captured assembly. |
| fixtures | array | check:'assembly-path' with stability:true — declared base/fixture part names, stable from step 1. Default: the lowest part(s) along gravity. |
| heatmaps | boolean | check:'load-capacity' mode:'fea' — also render stress heatmap PNGs (default false). |
| material | string | check:'dfm-preflight' — material SKU (required for that check). |
| sequence | boolean | check:'assembly-path' — plan a build sequence { steps, model, unknown, search?, requiresForce?, toolBlocked?, needsHold? }. Fastened/fixed clusters become subassemblies planned inside and installed as one unit; steps carry the insertion direction (reverse removal), and may be motion: helical (declar… |
| supports | object | check:'motion-load' — mechanicalJoint name -> support part names to use instead of the declared supports (compare with / without a bushing). |
| tip_link | string | check:'reachable' — end-effector part name (required for that check). |
| fasteners | array | check:'fastener-installation' — explicit named stations; empty means no coverage. |
| materials | object | check:'load-capacity' — partName -> material declaration. |
| mesh_size | number | check:'load-capacity' mode:'fea' — element size override, mm. |
| sample_ms | number | check:'motion-load' — timeline sample step, ms (default 20). Inertia peaks depend on it at keyframe velocity steps. |
| stability | boolean | check:'assembly-path' — run the approximate P3 static-stability pass on the sequence. Each part's closed-mesh volume centroid (uniform density) must project inside the convex hull of its contacts with already-stable parts. Unsupported parts become needsHold { part, reason, supports } and ok:false; a… |
| urdf_path | string | check:'urdf' — path to the .urdf file. |
| directions | array | check:'assembly-path' — additional nonzero world-space removal vectors; normalized and deduplicated. |
| feature_id | string | check:'geometry-quality' — body feature to measure; defaults to script return. check:'edge-radius' — lowered feature; default the returned model. |
| resolution | number | check:'joint-range' — bisection tolerance in the joint's units (default 0.1 degrees or 0.05 mm). The reported stop is the clear side of the final bracket. |
| motion_mode | string | check:'motion-load' — 'tracks' (default): along the animationView timeline with inertia; 'range': quasi-static grid over each driven joint's limits; 'poses': exactly motion_poses (a user-named pose is one entry). |
| work_budget | number | check:'assembly-path' — positive finite per-call work allowance for mesh validation, acceleration builds and path checks. Default 8000000. Exhaustion remains unknown; job time and memory limits still apply. |
| clearance_mm | number | check:'joint-range' — surface clearance the suggested stop protects, mm (default 0.3). |
| motion_loads | array | check:'motion-load' — external forces: [{ part, point: [x,y,z] mm in the part's modeled frame, force: [Fx,Fy,Fz] N world, from_ms?, to_ms? }]. |
| motion_poses | array | check:'motion-load' motion_mode:'poses' — explicit mate poses, each an object of joint name -> value in degrees. |
| quasi_static | boolean | check:'motion-load' — drop velocity/acceleration terms (gravity and external loads only). |
| requirements | array | Call-time external requirements ([{ name, predicate }]) measured in the same ledger as script require(), dfmSpec and feaStudy, tagged source: 'external' and never persisted. The predicate is the serializable form of require(): { metric: clearance | distance | mass | volume | bbox | centerOfMass | co… |
| sweep_budget | number | check:'joint-range' — face-weighted exact BREP distance budget (default 40000). 0, or a probe that would pass the budget, returns unknown. Never a clear range. |
| thickness_in | number | check:'dfm-preflight' — material thickness in inches. |
| thickness_mm | number | check:'dfm-preflight' — material thickness in millimeters. |
| tolerance_mm | number | check:'fastener-installation' — linear tolerance, default .05 mm. |
| max_radius_mm | number | check:'edge-radius' — maximum fillet radius in mm; must be >= min_radius_mm. |
| min_radius_mm | number | check:'edge-radius' — minimum fillet radius in mm (does not imply sharp-edge prohibition). |
| prefer_solver | string | check:'reachable' — force the IK path ('auto' default). |
| range_samples | number | check:'static-hold' — grid density per evaluated joint when `pose` is omitted (default 9). check:'motion-load' motion_mode:'range' — grid points per joint (default 5). |
| series_points | number | check:'motion-load' — max torque-vs-time points per joint in the result (default 120; 0 omits the series). |
| asserted_plane | object | check:'geometry-quality' — optional required mirror plane in model coordinates; normal is normalized and must be nonzero. |
| max_iterations | number | check:'reachable' — numeric-path iteration cap. |
| refresh_catalog | boolean | check:'dfm-preflight' — force vendor catalog refresh. |
| target_position | array | check:'reachable' — target [x, y, z] mm (world frame). |
| min_clearance_mm | number | check:'clearance-range' — planned clearance (mm) for movable mate pairs without a declared clearances entry; overrides dfmSpec minClearance. |
| samples_per_mate | integer | check:'clearance-range' — pose samples per limited mate: min, interior..., max (default 5). |
| disassembly_order | boolean | check:'assembly-path' — iteratively remove freed parts and return removalOrder or stuckParts. |
| mesh_deflection_mm | number | check:'geometry-quality' — absolute mesh deflection, defaults to tolerance/4; must be <= tolerance/2. |
…and 14 more parameters.
| normal_b | array | kind:'planeBlend' — unit normal of the second planar support face. |
| periodic | object | kind:'nurbs' — optional periodic flags per parametric direction. |
| pull_dir | array | kind:'draft' — demoulding direction as [x, y, z]. Defaults to the face normal at lower time. |
| sampling | integer | kind:'boundary' — points sampled along each boundary (default 15). |
| angle_deg | number | kind:'draft' — draft angle in degrees [0, 90]. The face is tapered outward by this angle relative to the pull direction. |
| extrusion | array | kind:'patchFamily' — finite non-zero translation [x, y, z] in mm from the first NURBS cap to the opposite cap. |
| tolerance | number | kind:'sew' — edge-merging tolerance in mm (default 1e-6). Edges within this distance are merged. |
| by_binding | string | kind:'trim' — JS variable name of the cutter Surface (must be declared in source). Shape/Curve3D cutters are deferred. |
| continuity | any | kind:'boundary' — C0 only; C1/C2 fail because no neighboring support surfaces are supplied. kind:'sew' — minimum sampled continuity for every topology-enumerated shared seam ('G0' | 'G1' | 'G2' | 'G3' | 'G4'); G3/G4 use common-UV NURBS samples and are explicitly uncertified, not exact or seam-wide p… |
| split_knot | number | kind:'patchFamily' — optional knot value to split at; defaults to the first interior knot whose multiplicity gives C4 or better. |
| binding_name | string | JS const name for the new binding (kind:'nurbs' default surface_<N>; kind:'patchFamily' default patch_family_<N>; kind:'planeBlend' default plane_blend_<N>; kind:'boundary' default _surface_<N>; kind:'trim' default _trimmed_<N>; kind:'sew' default _sewn_<N>; kind:'draft' default _drafted_<N>). |
| neutral_plane | string | kind:'draft' — parting-line face (the plane where drafted faces remain fixed). Defaults to `face` if omitted. |
| shape_binding | string | kind:'draft' — JS variable name of the Shape to taper (must be declared in source). |
| curve_bindings | array | kind:'boundary' — tuple of 4 existing Curve3D variable names (bottom, right, top, left) declared earlier in the source. |
| face_tolerance | number | kind:'patchFamily' — positive OCCT face-construction tolerance in mm (default 1e-6). |
| rail_a_binding | string | kind:'planeBlend' — existing Curve3D variable name for the first straight support rail. |
| rail_b_binding | string | kind:'planeBlend' — existing Curve3D variable name for the second corresponding, parallel support rail. |
| require_closed | boolean | kind:'sew' — when true the lowerer emits feature.surface-sew.open-shell if the stitched result is not a watertight solid. |
| split_direction | string | kind:'patchFamily' — parameter direction for the shared interior knot with multiplicity <= degree - 4 and measured target seam. |
| surface_binding | string | kind:'trim' — JS variable name of the Surface to trim/split (must be declared in source). |
| handle_length_mm | number | kind:'planeBlend' — positive quintic control-handle length in mm; default is one tenth of the rail gap. |
| surface_bindings | array | kind:'sew' — JS variable names of the surfaces to stitch into a solid (each must be declared in source). |
| section_sketch_ids | array | kind:'nurbs' — existing sketch FeatureIds (2 or more) to skin a surface through, in order. |
| output_dir |
| string |
| target:'part' — destination directory (all-parts mode); files are <dir>/<part>.stl. Hosted server: only the file name is used; the file is written to a server-owned directory and returned as a download link. |
| output_path | string | Destination path (a directory for format 'bend-table'). target:'model' — the export file (required). target:'part' — single-part .stl path. Hosted server: only the file name is used; the file is written to a server-owned directory and returned as a download link. |
| quality_gate | string | Geometry-quality gate for stl/step/3mf/obj/ply/gcode (both targets): 'warn' exports and reports geometryQuality + warn diagnostics, 'block' fails the export (nothing written) when tiny faces or short edges are found, 'off' skips it. |
| tiny_face_area_mm2 | number | Quality gate threshold: faces with BREP area below this (mm²) are tiny. Default 0.01; 0 disables. |
| short_edge_length_mm | number | Quality gate threshold: edges shorter than this (mm) are short. Default 0.1; 0 disables. |
| preset | string | Render look: 'default' (engineering review) or 'publish' (studio product shot for sharing; one 'hero' image unless views/pose are given). |
| shadow | boolean | preset 'publish' only: soft contact shadow under the model (default true). |
| explode | object | Pull a multi-part assembly apart for the preview. factor ≥ 0 scales spacing by part size; mode is 'mate-axis' (default, along parent mate/joint axes) or 'radial' (away from the assembly centroid). Requires the script to return assembly.model() / solvedModel(). |
| out_dir | string | Directory for the PNGs (created if missing). Default: a fresh temp session dir. |
| overlay | string | Surface-quality overlay: 'zebra' (reflection stripes), 'curvature' (Gaussian vertex colours), 'continuity' (edges coloured G2 green / G1 yellow / G0 orange / broken red). Built as coloured STL bands through this same pipeline. |
| section | object | Cut the model with one axis-aligned section plane to inspect INTERIOR structure (wall thickness, internal pockets, whether a bore runs through) instead of only the outer shell. position is in mm along the axis (kernelCAD Z-up frame); flip keeps the +axis side (default keeps the -axis side). |
| shading | string | Mesh shading: 'smooth' uses the kernel's vertex normals (default); 'flat' uses face normals to expose tessellation / surface wobble. |
| base_url | string | Advanced: force a specific render server (e.g. a running studio dev server) instead of the bundled static player. |
| background | string | preset 'publish' only: 'white' (default), 'light', 'dark', 'black', 'transparent' (PNG alpha), or '#rrggbb'. |
| environment | string | HDRI environment override: preset ('studio', 'softbox', 'neutral', 'outdoor', 'warehouse'), a URL, or 'none' for the default three-light rig. |
| no_watermark | boolean | Suppress the kernelCAD version watermark. |
| no_mechanism_check | boolean | Skip the mechanism-truth probe for fast iteration on large assemblies; the preview reports mechanism: 'unverified'. Ignored under KERNELCAD_RENDER_STRICT=1. |
| screenshot_timeout_ms | integer | Playwright screenshot deadline in milliseconds. Default leaves Playwright's 30 s in place; raise it for heavy lofts or a slow machine. |
| Injection molding: thickest / thinnest wall above this warns (non-uniform walls warp and sink). Default 2.5. |
| pull_direction | string | Injection molding: part-local mold-opening axis (the two halves separate along ±this). Default '+z'. |
| build_direction | string | FDM part-local axis pointing up from the bed. Default '+z'. |
| max_overhang_deg | number | FDM steepest printable overhang, degrees from vertical (0 = wall, 90 = flat ceiling). Default 45. |
| tool_diameter_mm | number | CNC end-mill diameter, mm. Default 6. |
| max_undercut_area_mm2 | number | CNC unreachable area tolerated before cnc.undercuts fails, mm². Default 1. |
| min_bend_radius_ratio | number | Sheet metal: inner bend radius must be ≥ this × thickness. Default 1. |
| min_flange_thicknesses | number | Sheet metal: flange length from the outside of the bend must be ≥ this × thickness. Default 4. |
| hole_to_bend_thicknesses | number | Sheet metal: hole edge to bend line must be ≥ this × thickness + bend radius. Default 2.5. |
| hole_to_edge_thicknesses | number | Sheet metal: hole edge to blank edge must be ≥ this × thickness. Default 2. |