Skip to main content
Glama
Kiro MCP Server

Kiro MCP Server

Close a Kiro session

kiro_session_close
Idempotent

Close an attached Kiro session to cancel its running turn, reject pending permissions, and return the final cursor for later resumption.

Instructions

Close an attached session (session/close), like /quit: cancels its running turn, rejects its pending permissions, and returns the final cursor. The session stays in Kiro's store (use kiro_session_load to resume it), and its event feed stays readable for an hour so streams can drain.

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": {
      "session_id": "<session_id>"
    },
    "name": "kiro_session_close"
  }
}

Input Schema

NameRequiredDescriptionDefault
session_idYesKiro session id (sess_<uuid>).

Output Schema

NameRequiredDescriptionDefault
closedYes
session_idYes
final_cursorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.5/5.0
Behavior5/5

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

The annotations only declare the safety profile (not read-only, not destructive, idempotent); the description goes well beyond them by disclosing what actually happens on close (turn cancelled, pending permissions rejected), what is returned (final cursor), and what persists afterwards (session remains in the store, event feed readable for an hour). That retention window is exactly the kind of consequence an agent cannot get from structured fields.

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

Conciseness5/5

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

A single tight sentence front-loads the action and its slash-command analogue, then packs effects, return value, and post-close state without a wasted clause. Nothing is repeated from the schema or annotations.

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

Completeness5/5

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

With an output schema covering return values and annotations covering safety, the description supplies the remaining pieces an agent needs: side effects, reversibility path via kiro_session_load, and the one-hour event feed window. Nothing material for correct invocation is missing.

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 100%, and the single session_id parameter is fully documented with its format in the schema. The description adds no further meaning about the identifier beyond calling the target an "attached session," so the baseline of 3 applies.

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?

The description states a specific verb and resource ("Close an attached session") and immediately enumerates the concrete effects: cancels the running turn, rejects pending permissions, returns the final cursor. It also implicitly distinguishes itself from kiro_session_delete by noting the session stays in Kiro's store, so an agent can separate it from its closest 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?

It names the alternative for the opposite intent explicitly ("use kiro_session_load to resume it") and clarifies the semantics of closing versus removing. It stops short of routing between close and the kiro_cancel sibling, even though both mention cancelling a running turn, so one overlap is left to inference.

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