Start a do-file in the background
stata_job_submitSubmit a .do file as its own background Stata process and get an immediate job ID for long analyses, then poll job status instead of blocking the interactive service.
Instructions
Run a do-file as its own Stata process and return a job id immediately. Use this for analyses that take longer than a couple of minutes: the HTTP service is single-threaded (it answers 409 while busy) and caps each call, while a job has no ceiling and leaves the interactive session free. Poll with stata_job_status.
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": {
"file": "<file>"
},
"name": "stata_job_submit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory override (default: the do-file folder). | |
| file | Yes | Absolute path to the .do file. | |
| mode | No | Tighten the policy for this call. | |
| label | No | Short human label shown in stata_job_list. | |
| timeout | No | Wall-clock ceiling in seconds before the job is killed (default 1800). |