Skip to main content
Glama

ssh_session_close

Close SSH connections to remote servers by specifying a session ID or terminating all active sessions. This tool helps manage server resources and maintain security by ending unused connections.

Instructions

Close an SSH session

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionYesSession ID to close (or "all" to close all sessions)

Implementation Reference

  • Registration of 'ssh_session_close' tool in the 'sessions' group of the centralized tool registry used for conditional tool enablement based on user configuration.
    sessions: [ 'ssh_session_start', 'ssh_session_send', 'ssh_session_list', 'ssh_session_close' ],
  • Core helper function that closes an SSH session by ID by calling the session's close method and removing it from the active sessions map. This implements the primary logic for the ssh_session_close tool.
    /** * Close a session */ export function closeSession(sessionId) { const session = sessions.get(sessionId); if (!session) { throw new Error(`Session ${sessionId} not found`); } session.close(); return true;

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/bvisible/mcp-ssh-manager'

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