Skip to main content
Glama

ssh_add_host

Register a new SSH host to the inventory with alias, hostname, username, and authentication method. Supports key, password, or agent-based logins.

Instructions

Register a new SSH host in the inventory.

Saves the host details to hosts.yaml so it can be referenced by alias in all other ssh_* tools. Supports key, password, and agent authentication.

Args: alias: Short nickname for the host (e.g., 'webserver', 'db-prod'). Only letters, digits, underscores, and hyphens are allowed. hostname: IP address or FQDN (e.g., '192.168.1.10', 'db.example.com'). username: SSH login username (e.g., 'ubuntu', 'ec2-user'). auth_type: Authentication method — 'key' (private key file), 'password', or 'agent' (ssh-agent). port: SSH port (default 22). key_path: Required when auth_type='key'. Path to the private key file (e.g., '~/.ssh/id_rsa'). key_passphrase: Optional passphrase to decrypt an encrypted private key. password: Required when auth_type='password'. description: Optional human-readable note about this server. overwrite: Set True to replace an existing host with the same alias.

Returns: Success message or error description.

Examples: - Add a key-based host: alias='webserver', hostname='10.0.0.5', username='ubuntu', auth_type='key', key_path='~/.ssh/id_rsa' - Add a password host: alias='legacy', hostname='old.corp.net', username='admin', auth_type='password', password='s3cr3t' - Add an agent-auth host: alias='jump', hostname='bastion.example.com', username='ops', auth_type='agent'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aliasYes
hostnameYes
usernameYes
auth_typeYes
portNo
key_pathNo
key_passphraseNo
passwordNo
descriptionNo
overwriteNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Discloses supported authentication methods, parameter dependencies, and returns success/error, though annotations are minimal; misses details on side effects or permissions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with clear sections (Args, Returns, Examples); slightly verbose but each sentence adds value for a 10-parameter tool.

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

Completeness4/5

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

Covers all parameters, examples, and return type; lacks details about the hosts.yaml format or persistence, but sufficient for a registration tool.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by explaining each parameter, constraints, and conditional requirements (e.g., key_path for 'key' auth).

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?

Clearly states the action ('Register a new SSH host') and the storage location ('hosts.yaml'), distinguishing it from sibling tools like ssh_remove_host or ssh_list_hosts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides examples for different auth types and explains the overwrite parameter, but does not explicitly compare to alternatives or state when not to use.

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/muradmalik23/sshand'

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