DSL Language
How to create and edit parametric shapes from a line-based script (DSL), and how the MCP integration works.
Parametric shapes can also be created and edited from a line-based script (DSL). Instead of assembling the scene by clicking, you write the whole structure as text and run it in one go.
group "Table" @0,0,0
box "Top" w=2 h=.1 d=1 @0,1,0
cylinder "LegFL" r=.05 h=1 @-0.9,0,-0.4
cylinder "LegFR" r=.05 h=1 @0.9,0,-0.4
Two ways to run it
| Path | How | Docs |
|---|---|---|
| Script window | Paste a script into an editor window and press Run | Script Window |
| MCP tools | An MCP client drives the Unity Editor directly | MCP integration below |
Both paths run exactly the same code. Validation rules, error messages and Undo behavior are identical.
The MCP tools
| Tool | What it does | Syntax |
|---|---|---|
umx_parametric_shape | Create and edit parametric shapes in the scene. | Scene Script Syntax |
umx_hotspot | Create and edit hotspot layout assets. | Hotspot Script Syntax |
Both tools take a single parameter, script. Instead of one tool call per object, a whole structure is built from one script — which cuts the number of calls and the token cost dramatically.
MCP integration
UModeler X detects the MCP package installed in your project and registers its tools automatically. No configuration or extra code is needed.
| MCP package | Package name |
|---|---|
| Unity AI Assistant / Unity MCP | com.unity.ai.assistant |
| Coplay — MCP for Unity | com.coplaydev.unity-mcp |
| Unity-MCP (Ivan Murzak) | com.ivanmurzak.unity.mcp |
Once the package is installed and compilation finishes, umx_parametric_shape and umx_hotspot appear in your MCP client's tool list.
Rules shared by both syntaxes
umx_parametric_shape and umx_hotspot share the same parser rules.
- One statement per line.
- Indentation is exactly 2 spaces per level, and depth cannot increase by more than one level at a time. Tabs are not allowed.
- A line starting with
#is a comment. - Names are wrapped in double quotes —
"Table Top"may contain spaces. - Numbers use a period as the decimal separator (
0.5,.1), independent of your locale. - Returned names use the form
"Name#id". The#idpart is how you target exactly one object when several share a name.
Validation before execution
Every script goes through these stages.
- Parse — indentation and token format
- Static validation — shape kind and parameter name whitelists
- Preflight — modifier types and parameters, and whether referenced targets exist
- Execution
If any error is found in stages 1 – 3, the scene is left completely untouched and only the error list comes back. Error messages always include a line number, and typos come back with the list of valid values.
If an individual node fails during stage 4, only that node and its children are skipped and the rest continues. The failure list is returned with the result.
