m2_run_script
Run a Macaulay2 script in a fresh isolated process for long or self-contained computations. Get only printed output without affecting the persistent session.
Instructions
Run a .m2 file in a FRESH, isolated Macaulay2 process.
Does not touch the persistent session (and its state is not visible
afterwards). Use for long or self-contained computations, or when a
repeated m2_evaluate timeout suggests a heavy job. This is batch mode:
only explicit print output is returned — the script must print its
own results.
Args: path: ABSOLUTE path to the .m2 file, e.g. "/tmp/compute.m2". timeout_s: Author-set safety limit (default 120, max 3600). On timeout the process is killed and any partial output is returned.
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": {
"path": "<path>"
},
"name": "m2_run_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| timeout_s | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |