Skip to main content
Glama
balloonf
by balloonf

ssh_close_session

Terminate a specific SSH session using the session ID to manage active connections efficiently within the SSH MCP Server.

Instructions

특정 SSH 세션 종료

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes

Implementation Reference

  • main.py:296-306 (handler)
    MCP tool handler for 'ssh_close_session'. Calls the session manager to close the session and returns appropriate success/error message.
    async def ssh_close_session(session_id: str) -> str:
        """특정 SSH 세션 종료"""
        try:
            success = await ssh_manager.close_session(session_id)
            if success:
                return f"Session '{session_id}' closed successfully"
            else:
                return f"Session '{session_id}' not found"
        except Exception as e:
            return f"Failed to close session: {str(e)}"
  • Core implementation in SSHSessionManager that closes the SSH connection, cancels monitoring task, cleans up metadata, and logs the action.
    async def close_session(self, session_id: str) -> bool:
        """특정 세션 종료"""
        
        if session_id not in self.connections:
            return False
        
        try:
            # 연결 종료
            conn = self.connections[session_id]
            conn.close()
            
            # 모니터링 태스크 종료
            if session_id in self.connection_tasks:
                self.connection_tasks[session_id].cancel()
                del self.connection_tasks[session_id]
            
            # 메타데이터 정리
            del self.connections[session_id]
            del self.session_metadata[session_id]
            
            logger.info(f"SSH session closed: {session_id}")
            return True
            
        except Exception as e:
            logger.error(f"Error closing session {session_id}: {e}")
            return False
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('종료') but doesn't clarify whether this is destructive (e.g., terminates active processes), requires specific permissions, has side effects, or what happens on success/failure. For a mutation tool with zero annotation coverage, this leaves critical behavioral traits undocumented.

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 in Korean that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with no wasted verbiage, making it easy to parse quickly.

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's complexity (a mutation operation with no annotations, no output schema, and 1 undocumented parameter), the description is insufficient. It doesn't cover behavioral aspects like effects, error conditions, or return values, leaving the agent with significant gaps in understanding how to use the tool effectively.

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?

The description doesn't add any parameter-specific information beyond what the input schema provides. With 0% schema description coverage and 1 parameter, the baseline is 3 since the schema already documents the parameter's existence and type, but the description fails to compensate by explaining what 'session_id' represents or where to obtain it.

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 ('종료' meaning 'close' or 'terminate') and the resource ('SSH 세션' meaning 'SSH session'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'ssh_close_all_sessions' or 'ssh_list_sessions' beyond the implied specificity of closing a single session.

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 like needing an active session ID, nor does it contrast with 'ssh_close_all_sessions' for bulk operations or 'ssh_execute' for ongoing session use. Usage is implied but not explicitly stated.

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

Related 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/balloonf/ssh_mcp'

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