execute_python
Run raw Painter Python in an open Substance 3D Painter session when SP_MCP_ALLOW_EXECUTE_PYTHON=1; persist variables between calls and return results via result or printed output.
Instructions
Execute raw Painter Python only when SP_MCP_ALLOW_EXECUTE_PYTHON=1.
Variables survive between calls. Assign to result to return a value; printed
text comes back as output.
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": "execute_python"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||