Skip to main content
Glama
safe-ssh-mcp

safe-ssh-mcp

by Areso

get_dns_lookup

Check what a hostname resolves to from a remote Linux host over SSH; optionally run direct dig queries to inspect DNS status, records, and the answering server.

Instructions

Resolves a hostname (or reverse-resolves an IP address) ON a remote Linux host via SSH, and prints its /etc/resolv.conf. USE THIS TOOL to check what a name resolves to from that host. By default uses getent, which resolves exactly like applications on the host do (/etc/hosts, nsswitch.conf, then DNS). A name that does not resolve gives exit code 2. use_dig=True queries the DNS servers directly with dig (bypassing /etc/hosts) and returns the full answer: status (NOERROR, NXDOMAIN, SERVFAIL), CNAME chain, TTLs, the server that answered and query time. It fails with exit code 127 if dig is not installed - then use use_dig=False. The next two parameters require use_dig=True: record_type is one of A (default), AAAA, CNAME, MX, NS, TXT, SOA, PTR, SRV, CAA. server (IP address or hostname, e.g. '8.8.8.8') asks that DNS server instead of the ones in /etc/resolv.conf - compare both answers to tell a broken resolver from a broken record.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>",
      "host": "<host>",
      "user": "<user>"
    },
    "name": "get_dns_lookup"
  }
}

Input Schema

NameRequiredDescriptionDefault
hostYes
nameYes
portNo
userYes
serverNo
timeoutNo
use_digNo
key_pathNo
passwordNo
record_typeNoA
accept_new_hostkeyNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the resolution order (/etc/hosts, nsswitch.conf, then DNS), the exit-code semantics (2 for non-resolving names, 127 for missing dig), and what extra data dig mode returns (status, CNAME chain, TTLs, answering server, query time). It omits the security/auth side entirely — key_path, password, and especially accept_new_hostkey (default false, which means first-connection failure) are never mentioned.

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?

The description is front-loaded with purpose and trigger, then drills into mode behavior and per-parameter detail in a logical order. Nearly every sentence earns its place (exit codes, dig failure mode, enum list), though the mid-sentence line breaks and the paragraph-long block make it denser than necessary.

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?

An output schema exists, so return-format explanation is not required, and the tool complexity is well matched by the resolution/DNS reasoning the description provides. The remaining gap is the SSH connectivity and authentication parameters, which are left to the bare schema for an 11-parameter tool with zero annotation coverage.

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 description coverage is 0%, so the description must compensate, and it does richly for name, use_dig, record_type (with the full enum listed) and server (including an example value and the /etc/resolv.conf comparison trick). However, 7 of 11 parameters — host, user, port, timeout, key_path, password, accept_new_hostkey — get no semantic treatment at all, leaving the SSH connection surface undocumented.

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 names a specific verb+resource (resolve a hostname / reverse-resolve an IP) and, crucially, states the scope: it happens ON a remote Linux host via SSH, not locally. It also distinguishes its two modes (getent default vs. use_dig direct-DNS query), so an agent can tell exactly which capability it is invoking.

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?

It gives an explicit trigger ('USE THIS TOOL to check what a name resolves to from that host') and a concrete fallback rule: if dig is missing (exit 127), switch to use_dig=False. It also explains the diagnostic pattern of comparing server-specific answers against /etc/resolv.conf answers. It does not name any sibling tool to prefer or avoid, so it stops short of full alternative routing.

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