Skip to main content
Glama

close_connection

Terminate SSH sessions to securely end remote connections and release system resources when remote work is complete.

Instructions

Terminate an SSH session and remove it from global state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connection_idYes

Implementation Reference

  • Handler implementation for the 'close_connection' tool. It retrieves the SSH connection by ID from the global connections Map, ends the client connection, removes it from the Map, and returns a success response.
    if (name === "close_connection") { const { connection_id } = args as { connection_id: string }; const conn = connections.get(connection_id); if (!conn) throw new Error(`connection_id '${connection_id}' not found.`); conn.client.end(); connections.delete(connection_id); return { content: [ { type: "text", text: JSON.stringify({ closed: true }, null, 2), }, ], }; }
  • src/index.ts:196-205 (registration)
    Registration of the 'close_connection' tool in the ListTools response, including its name, description, and input schema.
    { name: "close_connection", description: "Terminate an SSH session and remove it from global state.", inputSchema: { type: "object", required: ["connection_id"], properties: { connection_id: { type: "string" } }, additionalProperties: false, }, },
  • Input schema definition for the 'close_connection' tool, specifying the required 'connection_id' parameter.
    inputSchema: { type: "object", required: ["connection_id"], properties: { connection_id: { type: "string" } }, additionalProperties: false, }, },

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/vilasone455/ssh-mcp-server'

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