Skip to main content
Glama

traceroute

Map the network path to a host, showing each hop and latency to pinpoint connection problems.

Instructions

Trace the network path to a host.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYes
max_hopsNo
timeoutNo

Implementation Reference

  • The traceroute tool handler function decorated with @mcp.tool(). It runs the system 'traceroute' command via subprocess, passing max_hops and timeout parameters, and returns the output as a dict.
    @mcp.tool()
    def traceroute(host: str, max_hops: int = 30, timeout: int = 60) -> dict:
        """Trace the network path to a host."""
        try:
            result = subprocess.run(
                ["traceroute", "-m", str(max_hops), host],
                capture_output=True,
                text=True,
                timeout=timeout,
            )
            return {
                "host": host,
                "output": result.stdout,
                "returncode": result.returncode,
            }
        except Exception as e:
            return {"error": str(e), "tool": "traceroute", "host": host}
  • The @mcp.tool() decorator on line 64 registers the traceroute function as an MCP tool with the FastMCP server instance.
    @mcp.tool()
  • The main() function that runs the MCP server, which serves all registered tools including traceroute.
    def main() -> None:
        mcp.run()
    
    
    if __name__ == "__main__":
        main()
  • The function signature defines the input schema: host (str, required), max_hops (int, default 30), timeout (int, default 60).
    def traceroute(host: str, max_hops: int = 30, timeout: int = 60) -> dict:
Behavior1/5

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

No annotations are provided, and the description lacks any behavioral details such as permissions needed, network protocol used, or potential blocking by firewalls.

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

Conciseness2/5

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

While short, the description is under-specified; it does not use the space effectively to convey additional useful information.

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

Completeness1/5

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

Given the absence of an output schema and 3 parameters, the description fails to explain what the tool returns or how parameters affect behavior, leaving significant gaps.

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

Parameters1/5

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

The description does not explain any parameters beyond their names in the schema; with 0% schema coverage, the description adds no semantic value for max_hops or timeout.

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 clearly states the action ('trace') and the resource ('network path to a host'), distinguishing it from sibling tools like ping and dns_lookup which have different purposes.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use traceroute versus alternative tools, nor any conditions or prerequisites for its 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/aaronckj/mcp-nettools'

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