Skip to main content
Glama

checkConnectivity

Verify SSH connection availability to a remote host by testing connectivity with the specified host alias.

Instructions

Checks if an SSH connection to the host is possible

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostAliasYesAlias or hostname of the SSH host

Implementation Reference

  • Implements the checkConnectivity tool by attempting an SSH connection to the specified hostAlias, executing an 'echo connected' command to verify, and returning ConnectionStatus with connected status and message.
    async checkConnectivity(hostAlias: string): Promise<ConnectionStatus> { try { // Establish connection await this.connectToHost(hostAlias); // Execute ping command const result = await this.ssh.execCommand('echo connected'); const connected = result.stdout.trim() === 'connected'; this.ssh.dispose(); return { connected, message: connected ? 'Connection successful' : 'Echo test failed' }; } catch (error) { console.error(`Connectivity error with ${hostAlias}:`, error); return { connected: false, message: error instanceof Error ? error.message : String(error) }; }
  • Type definition for the return type of checkConnectivity tool.
    export interface ConnectionStatus { connected: boolean; message: string; }

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

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