Skip to main content
Glama
samerfarida

MCP SSH Orchestrator

ssh_list_hosts

Retrieve a list of configured SSH hosts to manage server access and view available infrastructure for policy-driven operations.

Instructions

List configured hosts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The ssh_list_hosts tool handler function decorated with @mcp.tool(). It calls config.list_hosts() and returns the list of host aliases as a dict with key 'hosts', or an error string on failure.
    @mcp.tool()
    def ssh_list_hosts() -> ToolResult:
        """List configured hosts."""
        try:
            hosts = config.list_hosts()
            return {"hosts": hosts}
        except Exception as e:
            error_str = str(e)
            log_json({"level": "error", "msg": "list_hosts_exception", "error": error_str})
            return f"Error: {sanitize_error(error_str)}"
  • The tool is registered with MCP via the @mcp.tool() decorator on the ssh_list_hosts function at line 862.
    @mcp.tool()
    def ssh_list_hosts() -> ToolResult:
        """List configured hosts."""
  • The Config.list_hosts() helper method that reads host aliases from the servers.yml configuration and returns them as a list of strings.
    def list_hosts(self) -> list:
        """List all host aliases."""
        servers = self._data.get("servers", {}).get("hosts", [])
        result = []
        for h in servers:
            alias = str(h.get("alias", "")).strip()
            if alias:
                result.append(alias)
        return result
  • The function signature uses the ToolResult type alias (dict[str, Any] | str) defined at line 22, serving as the schema for return types - dict for success, str for errors.
    @mcp.tool()
    def ssh_list_hosts() -> ToolResult:
        """List configured hosts."""
Behavior2/5

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

No annotations are provided, so the description must carry the full burden of behavioral disclosure. It states only 'List configured hosts' with no mention of read-only nature, side effects, or any constraints. The agent has no information about the tool's behavior beyond the obvious.

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, consisting of a single sentence with no unnecessary words. It is front-loaded and clear. Every word earns its place.

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 no parameters and the presence of an output schema, the description is minimally adequate. However, it lacks context about the source of 'configured hosts' (e.g., from a configuration file) and doesn't clarify the scope. The agent might need more context for proper use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

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

The input schema has zero parameters with 100% description coverage (empty schema, fully described by its absence). The description adds no parameter information because none is needed. Per rubric, 0 params defaults to baseline 4.

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 'List configured hosts' with a specific verb and resource. It distinguishes from sibling tool ssh_describe_host (which describes a single host). However, it does not explicitly define 'configured hosts' and could be more precise about the scope.

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?

There are no usage guidelines provided. The description does not indicate when to use this tool versus alternatives like ssh_run or ssh_ping. The agent receives no guidance on context or exclusions.

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