Run Python
run_pythonExecute Python snippets with PyMOL cmd in scope to script molecular visualization and analysis; opt-in via PYMOL_MCP_ALLOW_CODE_EXEC=1.
Instructions
[opt-in] Execute a Python snippet with PyMOL cmd in scope. Requires PYMOL_MCP_ALLOW_CODE_EXEC=1.
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": "run_python"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python snippet; PyMOL `cmd` is in scope. Set a `result` variable to return a value. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |