Skip to main content
Glama

Diff CAD Scripts

diff_scripts
Read-only

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 ({ baseFile } or { baseCode }) 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), and param changes (value/min/max). Single-shape scripts diff as one "(root)" pseudo-part. Use after editing a script to verify exactly what changed physically before re-rendering. Read-only — never touches the active session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoRevised script — inline source.
fileNoRevised script — path to a .kcad.ts file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.
baseCodeNoBaseline script — inline source.
baseFileNoBaseline script — path to a .kcad.ts file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedOutput schema / properties
      Removed value: -{
      -  "base": {
      -    "additionalProperties": true,
      -    "description": "Baseline summary { featureCount, partCount, isAssembly } (success).",
      -    "type": "object"
      -  },
      -  "deeperDiffAvailable": {
      -    "additionalProperties": true,
      -    "description": "Present when the diff touched geometry-affecting ops: { tool: 'diff_geometry', reason, bodies } — the same two scripts can be compared at material level (added/removed/common volume + per-body verdict).",
      -    "type": "object"
      -  },
      -  "diagnostics": {
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "error": {
      -    "description": "Failure message (failure).",
      -    "type": "string"
      -  },
      -  "errorCode": {
      -    "type": "string"
      -  },
      -  "interference": {
      -    "additionalProperties": true,
      -    "description": "Total interference-volume delta + per-pair detail (success).",
      -    "type": "object"
      -  },
      -  "mates": {
      -    "additionalProperties": true,
      -    "description": "Mate-graph changes (success).",
      -    "type": "object"
      -  },
      -  "ok": {
      -    "type": "boolean"
      -  },
      -  "params": {
      -    "additionalProperties": true,
      -    "description": "Param value/min/max changes (success).",
      -    "type": "object"
      -  },
      -  "parts": {
      -    "additionalProperties": true,
      -    "description": "Per-part added/removed/renamed/changed/unchanged (success).",
      -    "type": "object"
      -  },
      -  "revised": {
      -    "additionalProperties": true,
      -    "description": "Revision summary { featureCount, partCount, isAssembly } (success).",
      -    "type": "object"
      -  },
      -  "side": {
      -    "description": "Which side failed ('base' | 'revised') (failure).",
      -    "type": "string"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "ok"
      -]
  2. Changed2 schema fields changed
    • changedInput schema / properties / baseFile / description
      Previous value: -"Baseline script — path to a .kcad.ts file."New value: +"Baseline script — path to a .kcad.ts file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
    • changedInput schema / properties / file / description
      Previous value: -"Revised script — path to a .kcad.ts file."New value: +"Revised script — path to a .kcad.ts file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
  3. Changed1 schema field changed
    • addedOutput schema / properties / deeperDiffAvailable
      Added value: +{
      +  "additionalProperties": true,
      +  "description": "Present when the diff touched geometry-affecting ops: { tool: 'diff_geometry', reason, bodies } — the same two scripts can be compared at material level (added/removed/common volume + per-body verdict).",
      +  "type": "object"
      +}
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "base": {
      +      "additionalProperties": true,
      +      "description": "Baseline summary { featureCount, partCount, isAssembly } (success).",
      +      "type": "object"
      +    },
      +    "diagnostics": {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "error": {
      +      "description": "Failure message (failure).",
      +      "type": "string"
      +    },
      +    "errorCode": {
      +      "type": "string"
      +    },
      +    "interference": {
      +      "additionalProperties": true,
      +      "description": "Total interference-volume delta + per-pair detail (success).",
      +      "type": "object"
      +    },
      +    "mates": {
      +      "additionalProperties": true,
      +      "description": "Mate-graph changes (success).",
      +      "type": "object"
      +    },
      +    "ok": {
      +      "type": "boolean"
      +    },
      +    "params": {
      +      "additionalProperties": true,
      +      "description": "Param value/min/max changes (success).",
      +      "type": "object"
      +    },
      +    "parts": {
      +      "additionalProperties": true,
      +      "description": "Per-part added/removed/renamed/changed/unchanged (success).",
      +      "type": "object"
      +    },
      +    "revised": {
      +      "additionalProperties": true,
      +      "description": "Revision summary { featureCount, partCount, isAssembly } (success).",
      +      "type": "object"
      +    },
      +    "side": {
      +      "description": "Which side failed ('base' | 'revised') (failure).",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  5. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.