Skip to main content
Glama
Kiro MCP Server

Kiro MCP Server

Run Kiro headless

kiro_run_headless

Starts 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

NameRequiredDescriptionDefault
cwdYesWorking directory inside KIRO_MCP_ROOTS.
modeNo
agentNo
cloudNo
modelNo
reposNo
effortNo
promptYes
wait_sNoSeconds to wait for the run to finish before returning the job (default 5, max 55).
resume_idNo
timeout_sNo
trust_toolsNo
require_sandboxNo
trust_all_toolsNo
trust_workspaceNo
workflow_timeout_sNo
require_mcp_startupNo

Output Schema

NameRequiredDescriptionDefault
cwdYes
errorYes
cursorYes
job_idYes
signalYes
statusYes
exit_codeYes
elapsed_msYes
final_textYes
run_statusYes
session_idYes
started_atYes
finished_atYes
stderr_tailYes
stop_reasonYes
exit_meaningYes
interruptionYes
final_text_truncatedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.2/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well past the annotations by explaining that approval prompts are impossible in headless mode, that unapproved actions are denied outright, and by naming the environment gates required for each trust flag (KIRO_MCP_HEADLESS_TRUST=all, tools or all, KIRO_MCP_ALLOW_TRUST_WORKSPACE). It also documents exit-code meanings (0 success, 3 MCP startup failed, 4 agent not found) and that authentication comes from the operator's CLI login or KIRO_API_KEY.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Information-dense and front-loaded: the core action comes first, then the polling/stop chain, then permission and trust constraints. The opening sentence is long and stacks several clauses, but nearly every clause carries operational weight, so little is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 17-parameter, open-world, non-idempotent execution tool this is only partially complete — the trust and exit-code story is covered and an output schema exists so return values need no prose, but most optional parameters and the interaction between cloud, repos, and require_sandbox are left unaddressed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 12% across 17 parameters, so the description carries a real burden and it only partially discharges it: it covers prompt-via-stdin, trust_all_tools, trust_tools, trust_workspace (with their env prerequisites), and gestures at cloud+repos. Parameters such as mode, agent, model, effort, resume_id, timeout_s, require_sandbox, workflow_timeout_s, and require_mcp_startup get no explanation of meaning or interaction from either source.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource — a fire-and-forget run of `kiro-cli chat --v3 --no-interactive --output-format stream-json` — plus the scope (directory inside KIRO_MCP_ROOTS, local or cloud) and the fact that the prompt is supplied via stdin. The 'fire-and-forget' framing plus the pointer to kiro_events/kiro_cancel clearly separates it from the session-oriented siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a clear operational chain: call this to start, poll kiro_events with the returned job_id, stop with kiro_cancel. It also signals when this is not appropriate by noting headless runs cannot ask for permission, so anything not pre-approved is denied. It stops short of naming kiro_prompt or kiro_stream_session as the alternative for interactive or approval-needing work.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.