Run Stata code
stata_runExecute Stata commands in a live session and return structured success, output, graphs, and warnings. Set cwd for relative paths or increase timeout for bootstrap and simulation loops.
Instructions
Execute a block of Stata commands in the live session and return structured results: success, return code, output transcript (truncated), generated graphs, and policy warnings. Set cwd when the code uses relative paths, and raise timeout for bootstrap/simulation loops.
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": "stata_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory applied before the code runs (absolute path). | |
| code | Yes | Stata commands, newline separated, as they would appear in a do-file. | |
| mode | No | Tighten the policy for this call (can only be stricter than the session mode). | |
| verify | No | Fingerprint the data before and after (datasignature) and report whether it changed. | |
| timeout | No | Seconds before Stata is interrupted (1-600, default 120). |