Run Kiro headless
kiro_run_headlessStarts a fire-and-forget headless Kiro CLI chat run in an allowed directory, locally or in the cloud, returning a job_id to poll events, get the final result, or cancel.
Instructions
Fire-and-forget run of kiro-cli chat --v3 --no-interactive --output-format stream-json in a directory inside KIRO_MCP_ROOTS, locally or in the cloud (cloud + repos). The prompt goes on stdin. Returns a job_id: poll kiro_events with job_id for streamed events and the final result (session id, final text, exit code and meaning: 0 success, 3 MCP startup failed, 4 agent not found), and stop it with kiro_cancel. Headless runs cannot ask for permission: anything not pre-approved is denied. trust_all_tools needs KIRO_MCP_HEADLESS_TRUST=all, trust_tools needs tools or all, and trust_workspace needs KIRO_MCP_ALLOW_TRUST_WORKSPACE. Uses the operator's CLI login or KIRO_API_KEY.
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": {
"cwd": "<cwd>",
"prompt": "<prompt>"
},
"name": "kiro_run_headless"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | Working directory inside KIRO_MCP_ROOTS. | |
| mode | No | ||
| agent | No | ||
| cloud | No | ||
| model | No | ||
| repos | No | ||
| effort | No | ||
| prompt | Yes | ||
| wait_s | No | Seconds to wait for the run to finish before returning the job (default 5, max 55). | |
| resume_id | No | ||
| timeout_s | No | ||
| trust_tools | No | ||
| require_sandbox | No | ||
| trust_all_tools | No | ||
| trust_workspace | No | ||
| workflow_timeout_s | No | ||
| require_mcp_startup | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | ||
| error | Yes | ||
| cursor | Yes | ||
| job_id | Yes | ||
| signal | Yes | ||
| status | Yes | ||
| exit_code | Yes | ||
| elapsed_ms | Yes | ||
| final_text | Yes | ||
| run_status | Yes | ||
| session_id | Yes | ||
| started_at | Yes | ||
| finished_at | Yes | ||
| stderr_tail | Yes | ||
| stop_reason | Yes | ||
| exit_meaning | Yes | ||
| interruption | Yes | ||
| final_text_truncated | Yes |