native_run_script
Runs a Python-subset modeling script to execute parametric 3D modeling, editing, import/export, and scene operations in Shapr3D via MCP.
Instructions
Run a modeling script: a Python subset with variables, for/if, lists, arithmetic and f-strings. No imports, attributes or def.
Functions are most native_* tools without the prefix (not restore, approve/revoke, look, cancel_tool or run_script itself), e.g. scene(), import_profile(name, entities, z_mm), extrude_profile(x_mm, y_mm, distance_mm), items(), rename_body(body_id, name), find_parts(body, kind, where), fillet_edges(radius_mm, body, where), create_variable(name, expression). Helpers: rectangle(x,y,width,height), circle(x,y,radius), polygon(points) return entity lists; range, len, min, max, abs, round, sqrt, sin/cos (degrees), print. A restore point named "script" is saved first. Stops at the first error.
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": {
"code": "<code>"
},
"name": "native_run_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| check_only | No | ||
| restore_on_error | No |