Skip to main content
Glama

htb_hosts_add

Add or update Hack The Box host entries in /etc/hosts without sudo so hostnames resolve to box IPs. Group entries in a managed block for later cleanup.

Instructions

Add or update an HTB host entry in /etc/hosts (no sudo needed). Use this whenever you need a hostname like machine.htb to resolve to a box IP. Entries go in a managed block and can be cleaned later.

Input Schema

NameRequiredDescriptionDefault
ipYesBox IP, e.g. 10.129.45.2
tagNoOptional group tag (defaults to the box name) for bulk cleanup
hostnamesYesOne or more hostnames, e.g. ['machine.htb','www.machine.htb']. A single comma/space separated string also works.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.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 burden well: it discloses that it writes to /etc/hosts, that no sudo is required, that entries are isolated in a managed block, and that the write is reversible via later cleanup. It stops short of saying whether an existing hostname mapping is overwritten or what the call returns.

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?

Three short sentences, each earning its place: what it does, when to use it, and how its effects are scoped/reversible. The key fact (no sudo) is front-loaded in the first sentence.

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?

For a three-parameter mutation of a system file with no annotations and no output schema, the description covers the essentials: where it writes, privilege requirements, scoping, and reversibility. Overwrite semantics for pre-existing hostnames are the one notable omission.

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?

Schema coverage is 100%, so baseline is 3; the description adds conceptual grounding by explaining the 'managed block' that the tag parameter's 'bulk cleanup' grouping relies on. That link between the tag and the cleanup lifecycle is real value beyond the schema text.

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?

States a specific verb pair ('add or update') plus the exact resource and location ('HTB host entry in /etc/hosts'), which is unambiguous. It does not explicitly name the sibling it complements (e.g. htb_hosts_remove/htb_hosts_clean), but the verb is distinct enough from the other hosts_* tools.

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?

'Use this whenever you need a hostname like machine.htb to resolve to a box IP' gives a concrete triggering condition with an example. It hints at the cleanup sibling ('can be cleaned later') but does not explicitly state when to prefer remove/clean/show instead.

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