Skip to main content
Glama

kiro_chat

Send chat messages to Kiro CLI for AI responses with session management, process pooling, and multi-project workflow support.

Instructions

Send a chat message to kiro-cli and get AI response

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesThe message to send to kiro-cli
session_idNoOptional session ID. Uses active session if not provided
streamNoWhether to stream the response

Implementation Reference

  • Primary handler function _handle_chat that executes the core logic: extracts arguments, gets/creates session, executes chat via command_executor, handles streaming flag (fallback), returns response as dict.
    async def _handle_chat(
        session_manager: SessionManager,
        command_executor: CommandExecutor,
        arguments: dict[str, Any]
    ) -> dict[str, Any]:
        """Handle kiro_chat tool call."""
        message = arguments.get("message", "")
        session_id = arguments.get("session_id")
        stream = arguments.get("stream", False)
    
        session = await session_manager.get_or_create_session(session_id)
    
        if stream:
            # Note: Streaming not fully supported in current MCP SDK
            # Fall back to non-streaming
            logger.warning("Streaming requested but not fully supported, using non-streaming")
    
        response = await command_executor.execute_chat(session, message)
        return response.to_dict()
  • Input schema definition for the kiro_chat tool, specifying parameters: message (required), session_id (optional), stream (boolean, default False).
    {
        "name": "kiro_chat",
        "description": "Send a chat message to kiro-cli and get AI response",
        "inputSchema": {
            "type": "object",
            "properties": {
                "message": {
                    "type": "string",
                    "description": "The message to send to kiro-cli"
                },
                "session_id": {
                    "type": "string",
                    "description": "Optional session ID. Uses active session if not provided"
                },
                "stream": {
                    "type": "boolean",
                    "description": "Whether to stream the response",
                    "default": False
                }
            },
            "required": ["message"]
        }
    },
  • Registration via handle_list_tools decorator (@server.list_tools()), which constructs and returns Tool objects from tools.py definitions, including kiro_chat.
    @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 logic in main @server.call_tool() handler that routes 'kiro_chat' calls to the _handle_chat function.
    if name == "kiro_chat":
        result = await _handle_chat(session_manager, command_executor, arguments)

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