Skip to main content
Glama

Apply Fillet or Chamfer Blend

apply_surface_blend
Idempotent

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]), 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.

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": {
      "code": "<code>",
      "shape_binding": "<shape_binding>"
    },
    "name": "apply_surface_blend"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesInline .kcad.ts source.
radiusNoFillet radius in mm; required for operation:'fillet'.
distanceNoChamfer distance in mm; required for operation:'chamfer'.
selectorNoOptional 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.
operationNoOperation; defaults to 'fillet'.
continuityNoRequested 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_bindingYesExisting Shape variable name to blend.
radius_profileNoOptional linear start/end radius profile along one selected fillet edge. When supplied, radius is not required.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / selector / description
      Previous value: -"Optional EdgeSelector: a canonical @kc[...] edge ref/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."New value: +"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."
    • changedInput schema / properties / selector / oneOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "minItems": 1,
      +    "type": "array"
      +  },
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  }
      +]
  2. Changed5 schema fields changed
    • changedInput schema / properties / continuity / description
      Previous value: -"Explicit fillet continuity; defaults to OCCT's existing behavior. Chamfer ignores this field."New value: +"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."
    • changedInput schema / properties / continuity / enum
      Previous value: -[
      -  "G1"
      -]New value: +[
      +  "G1",
      +  "G2",
      +  "G3",
      +  "G4"
      +]
    • addedInput schema / properties / radius_profile
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Optional linear start/end radius profile along one selected fillet edge. When supplied, radius is not required.",
      +  "properties": {
      +    "end": {
      +      "exclusiveMinimum": 0,
      +      "type": "number"
      +    },
      +    "start": {
      +      "exclusiveMinimum": 0,
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "start",
      +    "end"
      +  ],
      +  "type": "object"
      +}
    • changedInput schema / properties / selector / description
      Previous value: -"Optional EdgeSelector: a canonical @kc[...] edge ref/query string or { face: canonical face name, face label, or FaceQuery descriptor }. Omit to select all sharp edges."New value: +"Optional EdgeSelector: a canonical @kc[...] edge ref/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."
    • changedInput schema / properties / selector / oneOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "face": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "face"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  }
      +]
  3. Changed2 schema fields changed
    • changedInput schema / properties / continuity / description
      Previous value: -"Fillet continuity passed to the existing public API; defaults to G1. Chamfer ignores this field."New value: +"Explicit fillet continuity; defaults to OCCT's existing behavior. Chamfer ignores this field."
    • changedInput schema / properties / continuity / enum
      Previous value: -[
      -  "G1",
      -  "G2"
      -]New value: +[
      +  "G1"
      +]
  4. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare non-readOnly, idempotent, non-destructive, but the description adds substantive behavior: patched source plus evaluation diagnostics are returned, G2/G3/G4 constant-radius requests are refused, and out-of-support requests can downgrade with the named diagnostic feature.fillet.continuity-not-applicable. It stops short of stating persistence scope or whether the patched source must be re-evaluated.

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

Conciseness4/5

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

Front-loaded with the action and return value before the continuity caveats, and every sentence concerns a constraint an agent must respect. It is dense and slightly repetitive on selector syntax, which the schema already spells out.

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

Completeness4/5

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

For an eight-parameter, nested-schema mutation tool with an output schema, the description covers the non-obvious risks: continuity refusal and downgrade semantics, selector forms, and the shape-binding requirement. Minor gaps remain around what the diagnostics look like in failure cases, though the output schema carries return values.

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 baseline is 3, but the description adds real meaning: the selector grammar (stable @kc[...] refs, arrays, query strings, EdgeQuery, face descriptors), the one-selected-edge requirement for higher-order blends, and the measured-versus-requested continuity distinction for radius_profile. Some of that repeats the schema wording rather than extending it.

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?

States a specific verb and resource: author and evaluate a fillet or chamfer on a kernelCAD Shape, inserting Shape.fillet(...) or Shape.chamfer(...) and returning the patched source plus diagnostics. It also draws an explicit boundary ("does not extract blend-surface NURBS poles"), so an agent can separate it from extraction-oriented siblings.

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

Usage Guidelines4/5

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

Clear guidance on which mode applies: constant-radius fillets take G1 only, a linear two-station radius_profile uses the NURBS constrained route on one selected edge, and chamfer rejects continuity. It lacks explicit named alternatives for related work, but the conditions that select each path are stated.

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.