Skip to main content
Glama

kiro_session_save

Save current Kiro CLI session to a file for later restoration, enabling persistent workflow management across development sessions.

Instructions

Save current kiro-cli session to a file using /save command

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idNoOptional MCP session ID
pathYesPath to save session (relative to working directory)

Implementation Reference

  • Main handler function that executes the /save command in the kiro-cli session to save it to the specified path.
    async def _handle_session_save(
        session_manager: SessionManager,
        command_executor: CommandExecutor,
        arguments: dict[str, Any]
    ) -> dict[str, Any]:
        """Handle kiro_session_save tool call - save session using /save command."""
        session_id = arguments.get("session_id")
        save_path = arguments.get("path", "")
        
        if not save_path:
            return {
                "success": False,
                "error": "Path is required",
            }
        
        session = await session_manager.get_or_create_session(session_id)
        
        # Execute /save command
        result = await command_executor.execute_command(
            session,
            f"/save {save_path}"
        )
        
        return {
            **result.to_dict(),
            "session_id": session.id,
            "save_path": save_path,
        }
  • Input schema definition for the kiro_session_save tool, defining parameters session_id (optional) and path (required).
    {
        "name": "kiro_session_save",
        "description": "Save current kiro-cli session to a file using /save command",
        "inputSchema": {
            "type": "object",
            "properties": {
                "session_id": {
                    "type": "string",
                    "description": "Optional MCP session ID"
                },
                "path": {
                    "type": "string",
                    "description": "Path to save session (relative to working directory)"
                }
            },
            "required": ["path"]
        }
    }
  • Registration of the kiro_session_save handler in the main tool dispatch function handle_call_tool.
    elif name == "kiro_session_save":
        result = await _handle_session_save(
            session_manager, command_executor, arguments
        )
  • Tool listing handler that registers all tools including kiro_session_save via get_all_tools() 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
        ]
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool saves a session to a file, implying a write operation, but doesn't disclose behavioral traits such as whether it overwrites existing files, requires specific permissions, or what happens on failure. The mention of '/save command' adds some context but lacks details on side effects or limitations.

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, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse. Every word earns its place by conveying essential information without 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 tool has no annotations and no output schema, the description is incomplete. It lacks information on what the saved file contains, the format, success/failure responses, or error handling. For a write operation tool with 2 parameters, more context is needed to guide effective use, making it inadequate for the complexity.

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%, so the schema fully documents both parameters (session_id and path). The description doesn't add any meaning beyond the schema, such as explaining parameter interactions or usage examples. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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 ('Save') and resource ('current kiro-cli session to a file'), making the purpose understandable. It distinguishes from siblings like kiro_session_clear or kiro_session_end by specifying saving rather than clearing or ending. However, it doesn't explicitly differentiate from kiro_session_create or kiro_session_switch, which slightly reduces specificity.

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 mentions using '/save command' but doesn't explain when saving is appropriate compared to other session tools like kiro_session_list or kiro_session_clear. There are no explicit when/when-not statements or prerequisites, leaving usage context unclear.

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