exec_model_api
Run custom COMSOL Java API code to directly control models and automate modeling, meshing, solving, and post-processing tasks.
Instructions
Run arbitrary COMSOL Java API code.
Provide either a full class with public static String run(Model model),
or a Java snippet body; it will be wrapped automatically and executed in
the COMSOL JVM (best-effort in live mode, always via compile+run in
batch mode).
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": "exec_model_api"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |