Skip to main content
Glama

Evaluate SDF

evaluate_sdf
Read-only

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('', field) and pass that name as fieldName. Hint: pass either { file } or { code }, plus { fieldName, point: [x,y,z] }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoInline kernelCAD script source.
fileNoPath to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.
pointYesSample point [x, y, z] in mm.
fieldNameYessdf.bind binding name holding the SdfField.

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: -{
      -  "aabb": {
      -    "additionalProperties": true,
      -    "description": "Axis-aligned bounding box of the field (success).",
      -    "type": "object"
      -  },
      -  "distance": {
      -    "description": "Signed distance in mm; negative = inside (success).",
      -    "type": "number"
      -  },
      -  "error": {
      -    "type": "string"
      -  },
      -  "errorCode": {
      -    "type": "string"
      -  },
      -  "hint": {
      -    "type": "string"
      -  },
      -  "inside": {
      -    "description": "Whether the point is inside the surface (success).",
      -    "type": "boolean"
      -  },
      -  "kind": {
      -    "description": "SDF field kind (success).",
      -    "type": "string"
      -  },
      -  "ok": {
      -    "type": "boolean"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "ok"
      -]
  2. Changed1 schema field changed
    • changedInput schema / properties / file / description
      Previous value: -"Path to a .kcad.ts script file."New value: +"Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "aabb": {
      +      "additionalProperties": true,
      +      "description": "Axis-aligned bounding box of the field (success).",
      +      "type": "object"
      +    },
      +    "distance": {
      +      "description": "Signed distance in mm; negative = inside (success).",
      +      "type": "number"
      +    },
      +    "error": {
      +      "type": "string"
      +    },
      +    "errorCode": {
      +      "type": "string"
      +    },
      +    "hint": {
      +      "type": "string"
      +    },
      +    "inside": {
      +      "description": "Whether the point is inside the surface (success).",
      +      "type": "boolean"
      +    },
      +    "kind": {
      +      "description": "SDF field kind (success).",
      +      "type": "string"
      +    },
      +    "ok": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  4. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.