Parametric MCP programs with references
Build a controlled parametric job from freely chosen operations.
Updated:
Structure
A program contains parameters, steps and optional outputs. Each step has name, args and a unique as name. {"$expr":"width-2*wall"} computes a number. {"$ref":"base.id"} reads an earlier result ID; array positions are addressable too.
Example: dimension-driven base
{"parameters":{"width":80,"depth":60,"height":30},"steps":[{"name":"cad_create_box","as":"base","args":{"width":{"$expr":"width"},"depth":{"$expr":"depth"},"height":{"$expr":"height"},"center":[0,{"$expr":"height/2"},0]}}],"outputs":{"body":{"$ref":"base.id"}}}
A following topology step can use faceNormal=[0,1,0] to query upward faces. Use its current topologyToken and the appropriate face ID for hollowing. Query again after geometry changes.
Repetition and limits
repeat repeats a step a bounded number of times; index starts at zero and is available in expressions. Repeated results form an array. A program has at most 40 executed steps. Undo, interactive tools, nested plans/programs and product presets are excluded. Every operation must satisfy its own dimensional and geometry limits. A failed step rolls back the complete job. Concurrent document edits are also protected. Outputs are bounded; return only required fields. Request images separately with cad_get_view.