Skip to main content
Glama

Add Surface

add_surface
Idempotent

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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "kind": "<kind>",
      "code": "<code>"
    },
    "name": "add_surface"
  }
}

Input Schema

NameRequiredDescriptionDefault
opNokind:'trim' — 'trim' discards the smaller half (calls .trimTo()); 'split' retains both halves (calls .split()).
codeYesCurrent .kcad.ts source.
faceNokind:'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.
kindYesWhich surface-construction or surface-finishing path to use: 'nurbs' | 'patchFamily' | 'planeBlend' | 'boundary' | 'trim' | 'sew' | 'draft'.
knotsNokind:'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.
degreeNokind:'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.
weightsNokind:'nurbs' or 'patchFamily' — optional positive rational weights, same grid shape as controls. Rational weights are outside the restricted patchFamily analytic certificate class.
controlsNokind:'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_aNokind:'planeBlend' — unit normal of the first planar support face.
normal_bNokind:'planeBlend' — unit normal of the second planar support face.
periodicNokind:'nurbs' — optional periodic flags per parametric direction.
pull_dirNokind:'draft' — demoulding direction as [x, y, z]. Defaults to the face normal at lower time.
samplingNokind:'boundary' — points sampled along each boundary (default 15).
angle_degNokind:'draft' — draft angle in degrees [0, 90]. The face is tapered outward by this angle relative to the pull direction.
extrusionNokind:'patchFamily' — finite non-zero translation [x, y, z] in mm from the first NURBS cap to the opposite cap.
toleranceNokind:'sew' — edge-merging tolerance in mm (default 1e-6). Edges within this distance are merged.
by_bindingNokind:'trim' — JS variable name of the cutter Surface (must be declared in source). Shape/Curve3D cutters are deferred.
continuityNokind:'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_knotNokind:'patchFamily' — optional knot value to split at; defaults to the first interior knot whose multiplicity gives C4 or better.
binding_nameNoJS 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_planeNokind:'draft' — parting-line face (the plane where drafted faces remain fixed). Defaults to `face` if omitted.
shape_bindingNokind:'draft' — JS variable name of the Shape to taper (must be declared in source).
curve_bindingsNokind:'boundary' — tuple of 4 existing Curve3D variable names (bottom, right, top, left) declared earlier in the source.
face_toleranceNokind:'patchFamily' — positive OCCT face-construction tolerance in mm (default 1e-6).
rail_a_bindingNokind:'planeBlend' — existing Curve3D variable name for the first straight support rail.
rail_b_bindingNokind:'planeBlend' — existing Curve3D variable name for the second corresponding, parallel support rail.
require_closedNokind:'sew' — when true the lowerer emits feature.surface-sew.open-shell if the stitched result is not a watertight solid.
split_directionNokind:'patchFamily' — parameter direction for the shared interior knot with multiplicity <= degree - 4 and measured target seam.
surface_bindingNokind:'trim' — JS variable name of the Surface to trim/split (must be declared in source).
handle_length_mmNokind:'planeBlend' — positive quintic control-handle length in mm; default is one tenth of the rail gap.
surface_bindingsNokind:'sew' — JS variable names of the surfaces to stitch into a solid (each must be declared in source).
section_sketch_idsNokind:'nurbs' — existing sketch FeatureIds (2 or more) to skin a surface through, in order.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / controls / description
      Previous value: -"kind:'nurbs' or 'patchFamily' — control-point grid (controls[u][v] = [x, y, z], mm). patchFamily uses degree-5+ caps and a simple internal knot."New value: +"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."
    • changedInput schema / properties / degree / description
      Previous value: -"kind:'nurbs' or 'patchFamily' — degrees in U and V; patchFamily requires degree >= 5 in split_direction and enough controls for a simple internal knot."New value: +"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."
    • changedInput schema / properties / knots / description
      Previous value: -"kind:'nurbs' or 'patchFamily' — optional explicit knot vectors; missing => clamped uniform inferred. patchFamily split_knot must select a simple interior knot."New value: +"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."
    • changedInput schema / properties / split_direction / description
      Previous value: -"kind:'patchFamily' — parameter direction for the shared simple interior knot and measured target seam."New value: +"kind:'patchFamily' — parameter direction for the shared interior knot with multiplicity <= degree - 4 and measured target seam."
    • changedInput schema / properties / split_knot / description
      Previous value: -"kind:'patchFamily' — optional knot value to split at; defaults to the first simple interior knot."New value: +"kind:'patchFamily' — optional knot value to split at; defaults to the first interior knot whose multiplicity gives C4 or better."
  2. Changed1 schema field changed
    • changedInput schema / properties / weights / description
      Previous value: -"kind:'nurbs' or 'patchFamily' — optional positive rational weights, same grid shape as controls."New value: +"kind:'nurbs' or 'patchFamily' — optional positive rational weights, same grid shape as controls. Rational weights are outside the restricted patchFamily analytic certificate class."
  3. Changed1 schema field changed
    • changedInput schema / properties / continuity / description
      Previous value: -"kind:'boundary' — C0 only; C1/C2 fail because no neighboring support surfaces are supplied. kind:'sew' — minimum measured continuity for every shared seam ('G0' | 'G1' | 'G2' | 'G3' | 'G4'); G3/G4 require common-UV NURBS faces and the lowerer reports the achieved class."New value: +"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."
  4. Changed18 schema fields changed
    • changedInput schema / properties / binding_name / description
      Previous value: -"JS const name for the new binding (kind:'nurbs' default surface_<N>; kind:'boundary' default _surface_<N>; kind:'trim' default _trimmed_<N>; kind:'sew' default _sewn_<N>; kind:'draft' default _drafted_<N>)."New value: +"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>)."
    • changedInput schema / properties / continuity / description
      Previous value: -"kind:'boundary' — continuity grade applied to every edge ('C0' | 'C1' | 'C2'), or an array of 4 grades (one per edge, bottom/right/top/left order). Default 'C0'."New value: +"kind:'boundary' — C0 only; C1/C2 fail because no neighboring support surfaces are supplied. kind:'sew' — minimum measured continuity for every shared seam ('G0' | 'G1' | 'G2' | 'G3' | 'G4'); G3/G4 require common-UV NURBS faces and the lowerer reports the achieved class."
    • changedInput schema / properties / continuity / oneOf
      Previous value: -[
      -  {
      -    "enum": [
      -      "C0",
      -      "C1",
      -      "C2"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "items": {
      -      "enum": [
      -        "C0",
      -        "C1",
      -        "C2"
      -      ],
      -      "type": "string"
      -    },
      -    "maxItems": 4,
      -    "minItems": 4,
      -    "type": "array"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "C0",
      +      "C1",
      +      "C2",
      +      "G0",
      +      "G1",
      +      "G2",
      +      "G3",
      +      "G4"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "enum": [
      +        "C0",
      +        "C1",
      +        "C2"
      +      ],
      +      "type": "string"
      +    },
      +    "maxItems": 4,
      +    "minItems": 4,
      +    "type": "array"
      +  }
      +]
    • changedInput schema / properties / controls / description
      Previous value: -"kind:'nurbs' — control-point grid for direct construction (controls[u][v] = [x, y, z], mm)."New value: +"kind:'nurbs' or 'patchFamily' — control-point grid (controls[u][v] = [x, y, z], mm). patchFamily uses degree-5+ caps and a simple internal knot."
    • changedInput schema / properties / degree / description
      Previous value: -"kind:'nurbs' — degrees in U and V; each in [1, nU-1] / [1, nV-1]."New value: +"kind:'nurbs' or 'patchFamily' — degrees in U and V; patchFamily requires degree >= 5 in split_direction and enough controls for a simple internal knot."
    • addedInput schema / properties / extrusion
      Added value: +{
      +  "description": "kind:'patchFamily' — finite non-zero translation [x, y, z] in mm from the first NURBS cap to the opposite cap.",
      +  "items": {
      +    "type": "number"
      +  },
      +  "maxItems": 3,
      +  "minItems": 3,
      +  "type": "array"
      +}
    • addedInput schema / properties / face_tolerance
      Added value: +{
      +  "description": "kind:'patchFamily' — positive OCCT face-construction tolerance in mm (default 1e-6).",
      +  "exclusiveMinimum": 0,
      +  "type": "number"
      +}
    • addedInput schema / properties / handle_length_mm
      Added value: +{
      +  "description": "kind:'planeBlend' — positive quintic control-handle length in mm; default is one tenth of the rail gap.",
      +  "exclusiveMinimum": 0,
      +  "type": "number"
      +}
    • changedInput schema / properties / kind / description
      Previous value: -"Which surface-construction or surface-finishing path to use: 'nurbs' | 'boundary' | 'trim' | 'sew' | 'draft'."New value: +"Which surface-construction or surface-finishing path to use: 'nurbs' | 'patchFamily' | 'planeBlend' | 'boundary' | 'trim' | 'sew' | 'draft'."
    • changedInput schema / properties / kind / enum
      Previous value: -[
      -  "nurbs",
      -  "boundary",
      -  "trim",
      -  "sew",
      -  "draft"
      -]New value: +[
      +  "nurbs",
      +  "patchFamily",
      +  "planeBlend",
      +  "boundary",
      +  "trim",
      +  "sew",
      +  "draft"
      +]
    • changedInput schema / properties / knots / description
      Previous value: -"kind:'nurbs' — optional explicit knot vectors; missing => clamped uniform inferred."New value: +"kind:'nurbs' or 'patchFamily' — optional explicit knot vectors; missing => clamped uniform inferred. patchFamily split_knot must select a simple interior knot."
    • addedInput schema / properties / normal_a
      Added value: +{
      +  "description": "kind:'planeBlend' — unit normal of the first planar support face.",
      +  "items": {
      +    "type": "number"
      +  },
      +  "maxItems": 3,
      +  "minItems": 3,
      +  "type": "array"
      +}
    • addedInput schema / properties / normal_b
      Added value: +{
      +  "description": "kind:'planeBlend' — unit normal of the second planar support face.",
      +  "items": {
      +    "type": "number"
      +  },
      +  "maxItems": 3,
      +  "minItems": 3,
      +  "type": "array"
      +}
    • addedInput schema / properties / rail_a_binding
      Added value: +{
      +  "description": "kind:'planeBlend' — existing Curve3D variable name for the first straight support rail.",
      +  "type": "string"
      +}
    • addedInput schema / properties / rail_b_binding
      Added value: +{
      +  "description": "kind:'planeBlend' — existing Curve3D variable name for the second corresponding, parallel support rail.",
      +  "type": "string"
      +}
    • addedInput schema / properties / split_direction
      Added value: +{
      +  "description": "kind:'patchFamily' — parameter direction for the shared simple interior knot and measured target seam.",
      +  "enum": [
      +    "u",
      +    "v"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / split_knot
      Added value: +{
      +  "description": "kind:'patchFamily' — optional knot value to split at; defaults to the first simple interior knot.",
      +  "type": "number"
      +}
    • changedInput schema / properties / weights / description
      Previous value: -"kind:'nurbs' — optional rational weights, same grid shape as controls. Ignored in slice-1."New value: +"kind:'nurbs' or 'patchFamily' — optional positive rational weights, same grid shape as controls."
  5. Changed2 schema fields changed
    • removedOutput schema / properties
      Removed value: -{
      -  "binding_name": {
      -    "description": "JS const name bound to the new construct (when one was created).",
      -    "type": "string"
      -  },
      -  "diagnostics": {
      -    "description": "Diagnostics from re-evaluating the modified source.",
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "error": {
      -    "description": "Failure message (present when ok is false).",
      -    "type": "string"
      -  },
      -  "new_code": {
      -    "description": "Modified .kcad.ts source (present on success). Caller persists it.",
      -    "type": "string"
      -  },
      -  "ok": {
      -    "description": "Whether the edit applied and re-evaluated cleanly.",
      -    "type": "boolean"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "ok"
      -]
  6. Changed1 schema field changed
    • changedInput schema / properties / sampling / description
      Previous value: -"kind:'boundary' — OCCT NbPtsOnCur sampling parameter (default 15)."New value: +"kind:'boundary' — points sampled along each boundary (default 15)."
  7. Changed14 schema fields changed
    • addedInput schema / properties / angle_deg
      Added value: +{
      +  "description": "kind:'draft' — draft angle in degrees [0, 90]. The face is tapered outward by this angle relative to the pull direction.",
      +  "maximum": 90,
      +  "minimum": 0,
      +  "type": "number"
      +}
    • changedInput schema / properties / binding_name / description
      Previous value: -"JS const name for the new Surface binding (kind:'nurbs' default surface_<N>; kind:'boundary' default _surface_<N>)."New value: +"JS const name for the new binding (kind:'nurbs' default surface_<N>; kind:'boundary' default _surface_<N>; kind:'trim' default _trimmed_<N>; kind:'sew' default _sewn_<N>; kind:'draft' default _drafted_<N>)."
    • addedInput schema / properties / by_binding
      Added value: +{
      +  "description": "kind:'trim' — JS variable name of the cutter Surface (must be declared in source). Shape/Curve3D cutters are deferred.",
      +  "type": "string"
      +}
    • addedInput schema / properties / face
      Added value: +{
      +  "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.",
      +  "type": "string"
      +}
    • changedInput schema / properties / kind / description
      Previous value: -"Which surface-construction path to use."New value: +"Which surface-construction or surface-finishing path to use: 'nurbs' | 'boundary' | 'trim' | 'sew' | 'draft'."
    • changedInput schema / properties / kind / enum
      Previous value: -[
      -  "nurbs",
      -  "boundary"
      -]New value: +[
      +  "nurbs",
      +  "boundary",
      +  "trim",
      +  "sew",
      +  "draft"
      +]
    • addedInput schema / properties / neutral_plane
      Added value: +{
      +  "description": "kind:'draft' — parting-line face (the plane where drafted faces remain fixed). Defaults to `face` if omitted.",
      +  "type": "string"
      +}
    • addedInput schema / properties / op
      Added value: +{
      +  "description": "kind:'trim' — 'trim' discards the smaller half (calls .trimTo()); 'split' retains both halves (calls .split()).",
      +  "enum": [
      +    "trim",
      +    "split"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / pull_dir
      Added value: +{
      +  "description": "kind:'draft' — demoulding direction as [x, y, z]. Defaults to the face normal at lower time.",
      +  "items": {
      +    "type": "number"
      +  },
      +  "maxItems": 3,
      +  "minItems": 3,
      +  "type": "array"
      +}
    • addedInput schema / properties / require_closed
      Added value: +{
      +  "description": "kind:'sew' — when true the lowerer emits feature.surface-sew.open-shell if the stitched result is not a watertight solid.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / shape_binding
      Added value: +{
      +  "description": "kind:'draft' — JS variable name of the Shape to taper (must be declared in source).",
      +  "type": "string"
      +}
    • addedInput schema / properties / surface_binding
      Added value: +{
      +  "description": "kind:'trim' — JS variable name of the Surface to trim/split (must be declared in source).",
      +  "type": "string"
      +}
    • addedInput schema / properties / surface_bindings
      Added value: +{
      +  "description": "kind:'sew' — JS variable names of the surfaces to stitch into a solid (each must be declared in source).",
      +  "items": {
      +    "type": "string"
      +  },
      +  "minItems": 1,
      +  "type": "array"
      +}
    • addedInput schema / properties / tolerance
      Added value: +{
      +  "description": "kind:'sew' — edge-merging tolerance in mm (default 1e-6). Edges within this distance are merged.",
      +  "type": "number"
      +}
  8. Changed2 schema fields changed
    • changedInput schema / properties / continuity / description
      Previous value: -"kind:'boundary' — continuity grade applied to every edge ('C0' | 'C1' | 'C2'), or an array of 4 grades (one per edge). Default 'C0'."New value: +"kind:'boundary' — continuity grade applied to every edge ('C0' | 'C1' | 'C2'), or an array of 4 grades (one per edge, bottom/right/top/left order). Default 'C0'."
    • addedInput schema / properties / continuity / oneOf
      Added value: +[
      +  {
      +    "enum": [
      +      "C0",
      +      "C1",
      +      "C2"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "enum": [
      +        "C0",
      +        "C1",
      +        "C2"
      +      ],
      +      "type": "string"
      +    },
      +    "maxItems": 4,
      +    "minItems": 4,
      +    "type": "array"
      +  }
      +]
  9. Changed2 schema fields changed
    • changedInput schema / properties / continuity / description
      Previous value: -"kind:'boundary' — continuity grade applied to every edge ('C0' | 'C1' | 'C2'), or an array of 4 grades (one per edge, bottom/right/top/left order). Default 'C0'."New value: +"kind:'boundary' — continuity grade applied to every edge ('C0' | 'C1' | 'C2'), or an array of 4 grades (one per edge). Default 'C0'."
    • removedInput schema / properties / continuity / oneOf
      Removed value: -[
      -  {
      -    "enum": [
      -      "C0",
      -      "C1",
      -      "C2"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "items": {
      -      "enum": [
      -        "C0",
      -        "C1",
      -        "C2"
      -      ],
      -      "type": "string"
      -    },
      -    "maxItems": 4,
      -    "minItems": 4,
      -    "type": "array"
      -  }
      -]
  10. Changed2 schema fields changed
    • changedInput schema / properties / continuity / description
      Previous value: -"kind:'boundary' — continuity grade applied to every edge ('C0' | 'C1' | 'C2'), or an array of 4 grades (one per edge). Default 'C0'."New value: +"kind:'boundary' — continuity grade applied to every edge ('C0' | 'C1' | 'C2'), or an array of 4 grades (one per edge, bottom/right/top/left order). Default 'C0'."
    • addedInput schema / properties / continuity / oneOf
      Added value: +[
      +  {
      +    "enum": [
      +      "C0",
      +      "C1",
      +      "C2"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "enum": [
      +        "C0",
      +        "C1",
      +        "C2"
      +      ],
      +      "type": "string"
      +    },
      +    "maxItems": 4,
      +    "minItems": 4,
      +    "type": "array"
      +  }
      +]
  11. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "binding_name": {
      +      "description": "JS const name bound to the new construct (when one was created).",
      +      "type": "string"
      +    },
      +    "diagnostics": {
      +      "description": "Diagnostics from re-evaluating the modified source.",
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "error": {
      +      "description": "Failure message (present when ok is false).",
      +      "type": "string"
      +    },
      +    "new_code": {
      +      "description": "Modified .kcad.ts source (present on success). Caller persists it.",
      +      "type": "string"
      +    },
      +    "ok": {
      +      "description": "Whether the edit applied and re-evaluated cleanly.",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  12. Added

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, the description discloses that the tool inserts code into .kcad.ts, returns modified code plus diagnostics, fails closed per kind, emits warnings for uncertified continuity checks, and supports watertight/sew errors. This is rich behavioral context for a mutation tool whose annotations only mark it non-read-only and non-destructive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with usage guidance and structured by `kind`, but it is extremely long and dense. The patchFamily analytic-certificate paragraph in particular is highly verbose for a tool-selection and invocation description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 32-parameter tool with multiple construction paths, the description covers all kinds, required inputs, failure behavior, return code/diagnostics, and the Surface-to-Shape handoff. With an output schema present, it is complete enough for an agent to select and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents each parameter. The description still adds cross-parameter meaning, such as the alternative `controls` versus `section_sketch_ids` for `nurbs`, patchFamily multiplicity constraints, boundary endpoint coincidence within 1e-6 mm, and surface-to-Shape chaining, though much of the per-parameter text repeats the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: authoring or finishing a NURBS Surface into the user's .kcad.ts, selected by `kind`. It clearly names the surface authoring/finishing scope and distinguishes the seven paths, including a handoff to add_feature for thickening/toShape.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It opens with explicit when-to-use guidance for organic/freeform/swept surfaces and surface finishing, then gives per-kind conditions and constraints. It also names one alternative path, add_feature, for converting the returned Surface into a Shape.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.