Skip to main content
Glama

Evaluate SDF

evaluate_sdf
Read-onlyIdempotent

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 field_name. Hint: pass either { file } or { code }, plus { field_name, point: [x,y,z] }.

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": {
      "field_name": "<field_name>",
      "point": "<point>"
    },
    "name": "evaluate_sdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeNoInline kernelCAD script source.
fileNoPath to a .kcad.ts script file. Hosted: `code`, `project:<slug>` (head), or a Studio `/p/<slug>?version=N` link (pinned); no local files.
pointYesSample point [x, y, z] in mm.
field_nameYessdf.bind binding name holding the SdfField.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / file / description
      Previous 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."New value: +"Path to a .kcad.ts script file. Hosted: `code`, `project:<slug>` (head), or a Studio `/p/<slug>?version=N` link (pinned); no local files."
  2. Changed3 schema fields changed
    • removedInput schema / properties / fieldName
      Removed value: -{
      -  "description": "sdf.bind binding name holding the SdfField.",
      -  "type": "string"
      -}
    • addedInput schema / properties / field_name
      Added value: +{
      +  "description": "sdf.bind binding name holding the SdfField.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "fieldName",
      -  "point"
      -]New value: +[
      +  "field_name",
      +  "point"
      +]
  3. 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"
      -]
  4. 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."
  5. 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"
      +}
  6. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.