Skip to main content
Glama

ssh_resolve_host

Resolve SSH host aliases from ~/.ssh/config to obtain connection parameters for remote server automation.

Instructions

Resolves a host alias from ~/.ssh/config to connection parameters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostAliasYesHost alias from SSH config

Implementation Reference

  • The MCP tool handler for 'ssh_resolve_host' which invokes resolveSSHHost.
    case 'ssh_resolve_host': {
      const { hostAlias } = z.object({ hostAlias: z.string() }).parse(args);
      const resolved = await resolveSSHHost(hostAlias);
      logger.info('Host resolved', { hostAlias, resolved: resolved.host });
      return { content: [{ type: 'text', text: JSON.stringify(resolved, null, 2) }] };
    }
  • The core helper function that resolves an SSH host alias using the parser.
    export async function resolveSSHHost(hostAlias: string): Promise<{
        host: string;
        username?: string;
        port?: number;
        privateKeyPath?: string;
        proxyJump?: string;
    }> {
        const parser = await getSSHConfigParser();
        return parser.resolveHost(hostAlias);
    }
  • src/mcp.ts:366-376 (registration)
    Definition and registration of the 'ssh_resolve_host' tool in the MCP server.
    {
      name: 'ssh_resolve_host',
      description: 'Resolves a host alias from ~/.ssh/config to connection parameters',
      inputSchema: {
        type: 'object',
        properties: {
          hostAlias: { type: 'string', description: 'Host alias from SSH config' }
        },
        required: ['hostAlias']
      }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but lacks details on permissions needed, error handling (e.g., if the alias doesn't exist), or output format (e.g., what 'connection parameters' include). This is inadequate for a tool that reads system files.

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 a single, efficient sentence with zero wasted words. It front-loads the core purpose ('Resolves a host alias') and specifies the resource source (~/.ssh/config) and output ('connection parameters') concisely.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete. It doesn't explain what 'connection parameters' entail (e.g., hostname, port, user), error conditions, or dependencies on the SSH config file's existence. For a tool that interacts with system configuration, this leaves significant gaps.

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

Parameters3/5

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

The input schema has 100% description coverage, clearly documenting the single parameter 'hostAlias'. The description adds no additional semantic context beyond implying it reads from ~/.ssh/config, which is already suggested by the parameter description. This meets the baseline for high schema coverage.

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

Purpose5/5

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

The description clearly states the specific action ('Resolves') and resource ('a host alias from ~/.ssh/config'), distinguishing it from siblings like ssh_list_configured_hosts (which lists hosts) and ssh_open_session (which establishes connections). It precisely defines the tool's function without ambiguity.

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. It doesn't mention prerequisites (e.g., needing an SSH config file), exclusions, or related tools like ssh_list_configured_hosts for checking available aliases first. Usage context is implied but not explicit.

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

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