Skip to main content
Glama
balloonf
by balloonf

ssh_session_info

Retrieve detailed information about a specific SSH session to monitor connection status, execute commands, and manage remote interactions efficiently using the Model Context Protocol.

Instructions

특정 SSH 세션의 상세 정보 조회

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes

Implementation Reference

  • main.py:316-339 (handler)
    The handler function for the 'ssh_session_info' tool, registered via @mcp.tool() decorator. It fetches session details from the SSHSessionManager and formats them into a readable string output.
    @mcp.tool()
    async def ssh_session_info(session_id: str) -> str:
        """특정 SSH 세션의 상세 정보 조회"""
        try:
            info = await ssh_manager.get_session_info(session_id)
            
            uptime_min = int(info['uptime'] / 60)
            last_used_min = int((time.time() - info['last_used']) / 60)
            
            output = [
                f"SSH Session Info: {session_id}",
                "-" * 40,
                f"Host: {info['username']}@{info['host']}:{info['port']}",
                f"Status: {'Active' if info['is_active'] else 'Inactive'}",
                f"Created: {time.ctime(info['created_at'])}",
                f"Last Used: {last_used_min} minutes ago",
                f"Uptime: {uptime_min} minutes",
                f"Commands Executed: {info['command_count']}"
            ]
            
            return "\n".join(output)
            
        except Exception as e:
            return f"Failed to get session info: {str(e)}"
  • Supporting method in SSHSessionManager class that retrieves the raw session information dictionary, called by the tool handler.
    async def get_session_info(self, session_id: str) -> Dict[str, Any]:
        """세션 정보 조회"""
        
        if session_id not in self.connections:
            raise Exception(f"Session '{session_id}' not found")
        
        metadata = self.session_metadata[session_id]
        conn = self.connections[session_id]
        
        return {
            'session_id': session_id,
            'host': metadata['host'],
            'port': metadata['port'],
            'username': metadata['username'],
            'created_at': metadata['created_at'],
            'last_used': metadata['last_used'],
            'command_count': metadata['command_count'],
            'is_active': hasattr(conn, '_conn') and conn._conn is not None,
            'uptime': time.time() - metadata['created_at']
        }
  • main.py:316-316 (registration)
    The @mcp.tool() decorator that registers the ssh_session_info function as an MCP tool.
    @mcp.tool()
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 tool is for 'retrieving detailed information' (상세 정보 조회), implying a read-only operation, but doesn't specify what information is returned, whether it requires authentication, if there are rate limits, or how errors are handled. This is a significant gap for a tool with zero annotation coverage.

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 is appropriately sized and front-loaded, with zero waste, making it easy for an agent 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 read operation with one parameter), lack of annotations, no output schema, and 0% schema description coverage, the description is incomplete. It doesn't explain return values, error conditions, or parameter details, leaving critical gaps for the agent to understand 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.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate for the undocumented parameter 'session_id'. However, it adds no meaning beyond what the schema title ('Session Id') implies—it doesn't explain what a session ID is, how to obtain it, or its format (e.g., from 'ssh_list_sessions'). This fails to compensate for the low coverage.

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 tool's purpose as 'retrieving detailed information about a specific SSH session' (특정 SSH 세션의 상세 정보 조회), which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'ssh_list_sessions' (which likely lists multiple sessions) or 'ssh_execute' (which executes commands), so it misses full sibling differentiation.

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), exclusions, or comparisons to siblings like 'ssh_list_sessions' for broader queries or 'ssh_execute' for command execution, leaving the agent with no usage context.

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