codex_run
Start an asynchronous Codex CLI session to execute coding prompts in a specified working directory and return a job ID for polling; optionally wait up to 55 seconds for completion.
Instructions
Start a new asynchronous Codex CLI session (codex exec --json). Returns a job_id immediately (or waits up to wait_seconds <= 55s).
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": {
"prompt": "<prompt>",
"cwd": "<cwd>"
},
"name": "codex_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | Absolute path to the working directory. | |
| model | No | Optional Codex model override (-m). | |
| images | No | Optional image file paths (-i). | |
| prompt | Yes | Instructions sent to Codex via stdin. | |
| profile | No | Optional Codex config profile (-p). | |
| sandbox | No | Codex sandbox mode (-s). | |
| wait_seconds | No | Optional bounded wait (0..55 seconds) before returning. | |
| output_schema | No | Optional JSON Schema enforced on final output. | |
| max_duration_sec | No | Job timeout in seconds (default 900). | |
| reasoning_effort | No | Optional Codex reasoning effort override (-c model_reasoning_effort=..., e.g. low, medium, high, xhigh). | |
| skip_git_repo_check | No | Allow running outside a Git repository. |