kiro_history
Retrieve conversation history for a session to review past interactions and maintain context in multi-project workflows.
Instructions
Get conversation history for a session
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No | Optional session ID | |
| limit | No | Maximum number of messages to return |
Implementation Reference
- src/kiro_cli_mcp/server.py:289-305 (handler)Handler function that executes the kiro_history tool by retrieving conversation history for the specified session.async def _handle_history( session_manager: SessionManager, arguments: dict[str, Any] ) -> dict[str, Any]: """Handle kiro_history tool call.""" session_id = arguments.get("session_id") limit = arguments.get("limit", 50) session = await session_manager.get_or_create_session(session_id) history = session.get_history(limit) return { "session_id": session.id, "history": [msg.to_dict() for msg in history], "count": len(history), }
- src/kiro_cli_mcp/tools.py:109-126 (schema)Input schema definition for the kiro_history tool, including parameters for session_id and limit.{ "name": "kiro_history", "description": "Get conversation history for a session", "inputSchema": { "type": "object", "properties": { "session_id": { "type": "string", "description": "Optional session ID" }, "limit": { "type": "integer", "description": "Maximum number of messages to return", "default": 50 } } } },
- src/kiro_cli_mcp/server.py:67-79 (registration)Registration of tools via list_tools handler, which exposes kiro_history through the TOOLS list from tools.py.@server.list_tools() async def handle_list_tools() -> list[Tool]: """List available tools.""" tools_data = get_all_tools() return [ Tool( name=tool["name"], description=tool["description"], inputSchema=tool["inputSchema"] ) for tool in tools_data ]
- src/kiro_cli_mcp/server.py:110-112 (registration)Dispatch registration in call_tool handler routing kiro_history to its handler function.elif name == "kiro_history": result = await _handle_history(session_manager, arguments) elif name == "kiro_history_clear":