Skip to main content
Glama

get_hosts_file

Read-onlyIdempotent

Reads the system hosts file to return its location, active and commented-out name-to-address mappings, and full text for inspection or troubleshooting.

Instructions

The hosts file: where it is, its lines that map names to addresses (in use or turned off with #) and its whole text. It only reads; the Network page's Hosts and DNS tab edits it.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_hosts_file"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds genuinely new behavior: returned mappings include disabled entries marked with '#', and it clarifies that mutation is out of scope and happens elsewhere. Return shape is sketched but not detailed.

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?

A single compact sentence with the resource front-loaded and the read-only caveat trailing. The parenthetical about '#' is efficient, though the phrase 'its whole text' is slightly vague and could be tightened.

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?

With no output schema, the description carries the burden of describing the return value, and it roughly does so: location, parsed mappings (active and commented), and raw file text. For a no-parameter, read-only retrieval tool that is nearly complete; only the exact response structure is left implicit.

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?

The tool takes zero parameters and the schema is an empty object at full coverage, so the baseline is 4. There is no parameter meaning the description could add or omit.

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?

The description names the specific resource (the hosts file) and enumerates what the caller receives: its path, its name-to-address mappings including commented-out entries, and the full text. It is clearly distinguishable from every listed sibling, none of which touch the hosts file. It falls short of a 5 only because it is phrased as a noun list rather than a verb+resource statement.

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

Usage Guidelines3/5

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

It provides one explicit exclusion: this tool only reads, and editing happens on the Network page's Hosts and DNS tab. That is useful routing away from a write action, but it never states when an agent should reach for this tool (e.g. diagnosing name resolution or DNS-like overrides) nor names any sibling tool as an alternative data source.

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