Skip to main content
Glama

speedtest

Measure internet download and upload speeds by connecting to the nearest server.

Instructions

Run a network speed test using the nearest server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The speedtest() function is the handler that runs a network speed test using the speedtest-cli library. It is decorated with @mcp.tool() which registers it as an MCP tool. It gets the best server, measures download/upload speeds in Mbps, and returns the results including ping latency and server name.
    @mcp.tool()
    def speedtest() -> dict:
        """Run a network speed test using the nearest server."""
        try:
            st = _speedtest_lib.Speedtest()
            st.get_best_server()
            return {
                "download_mbps": round(st.download() / 1_000_000, 2),
                "upload_mbps": round(st.upload() / 1_000_000, 2),
                "ping_ms": st.results.ping,
                "server": st.results.server.get("name"),
            }
        except Exception as e:
            return {"error": str(e), "tool": "speedtest"}
  • The @mcp.tool() decorator on line 120 registers the speedtest function as an MCP tool with the FastMCP server instance.
    @mcp.tool()
  • The speedtest function has no parameters (takes no input), and returns a dict with keys: download_mbps, upload_mbps, ping_ms, server (on success) or error, tool (on failure).
    def speedtest() -> dict:
  • The speedtest-cli library is imported as _speedtest_lib and used internally by the speedtest handler.
    import speedtest as _speedtest_lib
  • The FastMCP server instance named 'nettools' that hosts all tools including speedtest.
    mcp = FastMCP("nettools")
Behavior2/5

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

With no annotations, the description must fully disclose behavior. It mentions using the nearest server but omits other traits such as potential data usage, required permissions, or output format. Minimal transparency.

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?

The description is a single concise sentence that efficiently conveys the tool's purpose without unnecessary words.

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

Completeness3/5

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

Although the tool is simple (no params, no output schema), the description could be improved by hinting at what the output contains, such as download/upload speeds or latency. Lacks completeness for an agent to fully understand the return value.

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 has zero parameters, so the schema provides complete coverage. The description adds no parameter information, but none is needed given no parameters exist.

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 (Run), resource (network speed test), and context (using the nearest server). It is distinct from sibling tools like ping or dns_lookup.

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?

No guidance is given on when to use this tool versus alternatives like ping or traceroute. The description does not specify any prerequisites or exclusions.

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