Skip to main content
Glama
andybrandt

MCP Simple Timeserver

Get UTC Time from an NTP Server

get_utc
Read-only

Get accurate UTC time from an NTP server to synchronize systems and applications across different timezones.

Instructions

Returns accurate UTC time from an NTP server. This provides a universal time reference regardless of local timezone.

:param server: NTP server address (default: pool.ntp.org)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverNopool.ntp.org

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function for the 'get_utc' MCP tool. It queries the specified NTP server using ntplib, computes the UTC time, formats it, and returns it as a string. Handles NTP exceptions gracefully.
    def get_utc(server: str = DEFAULT_NTP_SERVER) -> str:
        """
        Returns accurate UTC time from an NTP server.
        This provides a universal time reference regardless of local timezone.
        
        :param server: NTP server address (default: pool.ntp.org)
        """
        try:
            ntp_client = ntplib.NTPClient()
            response = ntp_client.request(server, version=3)
            utc_time = datetime.fromtimestamp(response.tx_time, tz=UTC)
            formatted_time = utc_time.strftime("%Y-%m-%d %H:%M:%S")
            return f"Current UTC Time from {server}: {formatted_time}"
        except ntplib.NTPException as e:
            return f"Error getting NTP time: {str(e)}"
  • FastMCP registration of the 'get_utc' tool using the @app.tool decorator, including metadata annotations for title and read-only hint.
    @app.tool(
        annotations = {
            "title": "Get UTC Time from an NTP Server",
            "readOnlyHint": True
        }
    )
  • Identical handler function for the 'get_utc' tool in the web-enabled server variant.
    def get_utc(server: str = DEFAULT_NTP_SERVER) -> str:
        """
        Returns accurate UTC time from an NTP server.
        This provides a universal time reference regardless of local timezone.
        
        :param server: NTP server address (default: pool.ntp.org)
        """
        try:
            ntp_client = ntplib.NTPClient()
            response = ntp_client.request(server, version=3)
            utc_time = datetime.fromtimestamp(response.tx_time, tz=UTC)
            formatted_time = utc_time.strftime("%Y-%m-%d %H:%M:%S")
            return f"Current UTC Time from {server}: {formatted_time}"
        except ntplib.NTPException as e:
            return f"Error getting NTP time: {str(e)}" 
  • FastMCP registration of the 'get_utc' tool in the web server variant.
    @app.tool(
        annotations = {
            "title": "Get UTC Time from an NTP Server",
            "readOnlyHint": True
        }
    )
  • Tool schema definition in the DXT manifest generator for packaging the MCP server.
        "name": "get_utc",
        "description": "Returns accurate UTC time from an NTP server."
    }
Behavior4/5

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

Annotations already declare readOnlyHint=true, indicating a safe read operation. The description adds useful context about accuracy ('accurate UTC time') and the universal time reference aspect, though it doesn't mention potential network dependencies or rate limits.

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 efficiently structured with three sentences that each add value: stating the core function, explaining the benefit, and clarifying the parameter. No wasted words.

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

Completeness5/5

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

Given the tool's simplicity (one optional parameter), presence of readOnlyHint annotation, and existence of an output schema, the description provides complete context for effective use without needing to explain return values.

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?

With 0% schema description coverage, the description compensates by explaining the 'server' parameter's purpose ('NTP server address') and default value, adding meaningful semantics beyond the bare schema.

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 specific action ('Returns accurate UTC time') and resource ('from an NTP server'), distinguishing it from the sibling tool 'get_local_time' by emphasizing universal time reference regardless of local timezone.

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?

The description provides clear context for when to use this tool ('provides a universal time reference regardless of local timezone'), which implicitly differentiates it from 'get_local_time', but doesn't explicitly state when not to use it or name alternatives.

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/andybrandt/mcp-simple-timeserver'

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