Skip to main content
Glama

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
NameRequiredDescriptionDefault
session_idNoOptional session ID
limitNoMaximum number of messages to return

Implementation Reference

  • 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),
        }
  • 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
                }
            }
        }
    },
  • 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
        ]
  • 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":
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but lacks critical behavioral details: it doesn't specify if this is a read-only operation (implied by 'Get' but not explicit), what the return format looks like (e.g., structured messages, timestamps), whether it requires authentication, or if there are rate limits. For a history retrieval tool, this leaves significant gaps in understanding its behavior.

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?

The description is a single, clear sentence that front-loads the core purpose without unnecessary words. It efficiently communicates the essential function, making it easy for an agent to parse quickly. Every word earns its place, with no redundancy or fluff.

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

Completeness2/5

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

Given the complexity of retrieving conversation history and the absence of both annotations and an output schema, the description is incomplete. It doesn't explain what 'conversation history' entails (e.g., message content, metadata, ordering), how results are structured, or potential errors. For a tool with no structured behavioral hints, this leaves the agent under-informed about critical operational aspects.

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%, with both parameters (session_id and limit) well-documented in the schema. The description adds no additional parameter semantics beyond implying the tool operates on sessions. This meets the baseline of 3 since the schema does the heavy lifting, but the description doesn't compensate with extra context like parameter interactions or examples.

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

Purpose4/5

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

The description clearly states the action ('Get') and resource ('conversation history for a session'), making the purpose immediately understandable. It distinguishes from siblings like kiro_chat (which appears to send messages) and kiro_history_clear (which clears history), though it doesn't explicitly contrast them. The description avoids tautology by specifying what type of history is retrieved.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an active session), when not to use it, or how it differs from related tools like kiro_session_list or kiro_task_list. The agent must infer usage from the tool name and context alone.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vanphappi/kiro-cli-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server