Skip to main content
Glama
yup-21
by yup-21

stop_session

Terminates an active crash analysis session to free system resources and end debugging processes.

Instructions

Terminates an active session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idNo

Implementation Reference

  • The `stop_session` tool handler, registered via `@mcp.tool()` decorator. Terminates the specified session (or last active one) by calling `session.stop()`, removing it from the sessions dictionary, and updating the last_session_id if necessary.
    @mcp.tool()
    def stop_session(session_id: Optional[str] = None) -> str:
        """Terminates an active session."""
        global last_session_id
        
        target_id = session_id or last_session_id
        
        if not target_id:
            return "Error: No session specified and no active default session."
        
        if target_id not in sessions:
            return f"Error: Session ID {target_id} not found."
            
        session = sessions[target_id]
        session.stop()
        del sessions[target_id]
        
        if last_session_id == target_id:
            last_session_id = None
            
        return f"Session {target_id} closed."

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/yup-21/crash-mcp'

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