Skip to main content
Glama

Query Geometry

query
Read-only

Use this when you need to resolve or inspect topology against a script's lowered geometry. Selected by mode (default 'evaluate'):

  • 'evaluate' — inspect a Query (@kc[...] ref, @kcq[...] DSL, or { ast }); returns matched entities. Pass expect:'unique' to assert exactly-one.

  • 'resolve' — resolve a single @kc[...] / @kcq[...] ref to one entity ({ ref }).

  • 'lineage' — walk the HistoryMap for a named face ref ({ feature_id, ref }). All params except mode are forwarded verbatim.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNomode:'resolve'|'lineage' — topology ref string.
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.
modeNoResolution mode (default 'evaluate').
queryNomode:'evaluate' — Query input: @kc[...] / @kcq[...] string or { ast } object.
expectNomode:'evaluate' — 'unique' asserts exactly-one.
feature_idNoOptional FeatureId; defaults to the last lowered shape (use "auto" for lineage).

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: -{
      -  "candidates": {
      -    "description": "mode:'resolve' — near-miss candidates (failure).",
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "chain": {
      -    "description": "mode:'lineage' — HistoryMap walk.",
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "entities": {
      -    "description": "mode:'evaluate' — matched entities.",
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "entity": {
      -    "additionalProperties": true,
      -    "description": "mode:'resolve' — the single matched entity.",
      -    "type": "object"
      -  },
      -  "error": {
      -    "type": "string"
      -  },
      -  "errorCode": {
      -    "type": "string"
      -  },
      -  "ok": {
      -    "type": "boolean"
      -  },
      -  "query": {
      -    "additionalProperties": true,
      -    "description": "mode:'evaluate' — the resolved Query ({ ast }).",
      -    "type": "object"
      -  },
      -  "ref": {
      -    "description": "mode:'resolve' — the resolved ref string.",
      -    "type": "string"
      -  },
      -  "warnings": {
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  }
      -}
    • 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": {
      +    "candidates": {
      +      "description": "mode:'resolve' — near-miss candidates (failure).",
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "chain": {
      +      "description": "mode:'lineage' — HistoryMap walk.",
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "entities": {
      +      "description": "mode:'evaluate' — matched entities.",
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "entity": {
      +      "additionalProperties": true,
      +      "description": "mode:'resolve' — the single matched entity.",
      +      "type": "object"
      +    },
      +    "error": {
      +      "type": "string"
      +    },
      +    "errorCode": {
      +      "type": "string"
      +    },
      +    "ok": {
      +      "type": "boolean"
      +    },
      +    "query": {
      +      "additionalProperties": true,
      +      "description": "mode:'evaluate' — the resolved Query ({ ast }).",
      +      "type": "object"
      +    },
      +    "ref": {
      +      "description": "mode:'resolve' — the resolved ref string.",
      +      "type": "string"
      +    },
      +    "warnings": {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  4. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.