Skip to main content
Glama

Trust host key

trust_host
DestructiveIdempotent

Scan a host for SSH keys and add them to known_hosts so non-interactive SSH skips the trust prompt; existing entries are replaced safely.

Instructions

Fetch a host's keys (ssh-keyscan) and add them to known_hosts.

The inverse of forget_host: afterwards a non-interactive ssh to the host won't stop on the trust prompt. Existing entries for the host are replaced, so it's safe to re-run after a key change. A host that returns no keys leaves known_hosts untouched.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesAlias from ~/.ssh/config (its hostname and port are scanned) or a hostname/IP.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
addedYeskeys added; 0 — the host returned none
targetYeshost name that was scanned
known_hosts_fileYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description adds real context beyond them: which file is mutated (known_hosts), that existing entries are replaced, and the edge case that a host returning no keys leaves the file untouched. It doesn't discuss permissions or side effects on other host entries, so not a 5.

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?

Core action is front-loaded in sentence one, followed by tightly-scoped behavior notes with no filler. The parenthetical and multi-clause sentences are slightly dense but each clause carries usable information.

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

Completeness5/5

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

For a one-parameter mutation tool with an output schema and annotations covering safety traits, the description covers the remaining gaps an agent needs: what is modified, replacement semantics, and the no-op edge case. Nothing needed to invoke it correctly is missing.

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?

Schema coverage is 100% and the single parameter has a detailed description covering both alias and hostname/IP forms. The description adds only the ssh-keyscan connection detail, so this is the baseline 3 where the schema does the heavy lifting.

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?

States a concrete verb + resource + implementation: 'Fetch a host's keys (ssh-keyscan) and add them to known_hosts.' It also positions itself against a sibling by calling itself 'the inverse of forget_host', so an agent can distinguish it from add_host/forget_host without opening schemas.

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?

Gives a clear usage context (afterwards a non-interactive ssh won't stop on the trust prompt) and names the inverse operation forget_host, plus the re-run-safe case. It stops short of explicit when-not guidance and doesn't distinguish itself from the sibling add_host, which could plausibly perform a similar trust action.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.