Skip to main content
Glama
samerfarida

MCP SSH Orchestrator

ssh_describe_host

Retrieve detailed host configuration in JSON format from the SSH Orchestrator to understand access policies and connection parameters for secure server management.

Instructions

Return host definition in JSON.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aliasNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function for the 'ssh_describe_host' MCP tool. Decorated with @mcp.tool() for registration. Validates the alias parameter using _validate_alias, fetches the host config via config.get_host(alias), and returns the host dict or an error string.
    def ssh_describe_host(alias: str = "") -> ToolResult:
        """Return host definition in JSON."""
        try:
            # Input validation
            valid, error_msg = _validate_alias(alias)
            if not valid:
                return f"Error: {error_msg}"
    
            host = config.get_host(alias)
            return host
        except Exception as e:
            error_str = str(e)
            log_json(
                {"level": "error", "msg": "describe_host_exception", "error": error_str}
            )
            return f"Error: {sanitize_error(error_str)}"
  • Helper function _validate_alias used by ssh_describe_host to validate the alias input parameter against security constraints (length, characters). Returns (valid, error_msg). Called at line 879.
    def _validate_alias(alias: str) -> tuple[bool, str]:
        """Validate alias parameter.
    
        Security: Validates alias format to prevent injection attacks.
        - Length limit: 100 characters
        - Allowed characters: alphanumeric, dash, underscore, dot
        - Cannot be empty
    
        Args:
            alias: Alias string to validate
    
        Returns:
            Tuple of (is_valid, error_message)
            If valid: (True, "")
            If invalid: (False, error_message)
        """
        if not alias or not alias.strip():
            return False, "alias is required"
    
        alias = alias.strip()
    
        # Length validation
        if len(alias) > MAX_ALIAS_LENGTH:
            return False, f"alias too long (max {MAX_ALIAS_LENGTH} characters)"
    
        # Character validation: alphanumeric, dash, underscore, dot only
        if not re.match(r"^[a-zA-Z0-9._-]+$", alias):
            return (
                False,
                "alias contains invalid characters (only alphanumeric, dot, dash, underscore allowed)",
            )
    
        return True, ""
  • The @mcp.tool() decorator registers the ssh_describe_host function as an MCP tool, making it available via the FastMCP server instance.
    def ssh_describe_host(alias: str = "") -> ToolResult:
        """Return host definition in JSON."""
        try:
            # Input validation
            valid, error_msg = _validate_alias(alias)
            if not valid:
                return f"Error: {error_msg}"
    
            host = config.get_host(alias)
            return host
        except Exception as e:
            error_str = str(e)
            log_json(
                {"level": "error", "msg": "describe_host_exception", "error": error_str}
            )
            return f"Error: {sanitize_error(error_str)}"
Behavior2/5

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

No annotations are provided, so the description carries full burden. It only states that the tool returns JSON, without disclosing any behavioral traits such as whether it's read-only, requires authentication, has rate limits, or what happens if the alias doesn't exist. This leaves significant gaps in understanding the tool's behavior.

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 extremely concise with just one sentence. It's front-loaded and wastes no words, making it easy to parse quickly. However, this conciseness comes at the cost of completeness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that there's an output schema (which should document the return format), the description doesn't need to explain return values. However, with 1 parameter and no annotations, the description is too minimal. It provides basic purpose but lacks usage context and parameter semantics, making it incomplete for effective tool selection.

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 input schema has 1 parameter with 0% description coverage, and the description provides no information about the 'alias' parameter. It doesn't explain what the alias is, how to use it, or what happens if it's omitted (default is empty string). The description fails to compensate for the low schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool returns a host definition in JSON format, which provides a basic purpose. However, it doesn't specify what a 'host definition' includes or differentiate this from sibling tools like 'ssh_list_hosts' or 'ssh_ping'. The purpose is somewhat vague rather than specific.

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. There are multiple sibling tools related to SSH hosts (e.g., ssh_list_hosts, ssh_ping), but no indication of when this specific tool is appropriate. No usage context or exclusions are mentioned.

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

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

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