Skip to main content
Glama
dumyCq

Time MCP Server

by dumyCq

get_current_time

Retrieve the current time for a specified timezone using IANA timezone names like 'America/New_York' or 'Europe/London'.

Instructions

Get current time in a specific timezones

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timezoneYesIANA timezone name (e.g., 'America/New_York', 'Europe/London'). Use 'Etc/UTC' as local timezone if no timezone provided by the user.

Implementation Reference

  • The core handler function that retrieves the current time in the specified timezone using zoneinfo and formats the result as a TimeResult object.
    def get_current_time(self, timezone_name: str) -> TimeResult:
        """Get current time in specified timezone"""
        timezone = get_zoneinfo(timezone_name)
        current_time = datetime.now(timezone)
    
        return TimeResult(
            timezone=timezone_name,
            datetime=current_time.isoformat(timespec="seconds"),
            is_dst=bool(current_time.dst()),
        )
  • Pydantic model defining the output schema for the get_current_time tool.
    class TimeResult(BaseModel):
        timezone: str
        datetime: str
        is_dst: bool
  • Registration of the get_current_time tool in the list_tools handler, including name, description, and input schema.
        name=TimeTools.GET_CURRENT_TIME.value,
        description="Get current time in a specific timezones",
        inputSchema={
            "type": "object",
            "properties": {
                "timezone": {
                    "type": "string",
                    "description": f"IANA timezone name (e.g., 'America/New_York', 'Europe/London'). Use '{local_tz}' as local timezone if no timezone provided by the user.",
                }
            },
            "required": ["timezone"],
        },
    ),
    Tool(
  • Dispatch logic in the call_tool handler that invokes the get_current_time method when the tool is called.
    case TimeTools.GET_CURRENT_TIME.value:
        timezone = arguments.get("timezone")
        if not timezone:
            raise ValueError("Missing required argument: timezone")
    
        result = time_server.get_current_time(timezone)
  • Enum defining the tool names, including get_current_time.
    class TimeTools(str, Enum):
        GET_CURRENT_TIME = "get_current_time"
        CONVERT_TIME = "convert_time"
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe any behavioral traits such as whether it's read-only, has rate limits, requires authentication, or what the output format looks like. This is a significant gap for a tool with zero annotation coverage.

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, efficient sentence with zero waste. It's appropriately sized and front-loaded, clearly stating the tool's purpose without unnecessary elaboration.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., time format, error handling) or provide behavioral context, which is essential for an agent to use it correctly without structured guidance.

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

Parameters3/5

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

The schema description coverage is 100%, with the parameter 'timezone' fully documented in the input schema. The description adds no additional meaning beyond what's in the schema, so it meets the baseline of 3 where the schema does the heavy lifting.

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 clearly states the tool's purpose with a specific verb ('Get') and resource ('current time'), and specifies the scope ('in a specific timezones'). It doesn't explicitly differentiate from the sibling 'convert_time' tool, which prevents a perfect score, but the purpose is unambiguous.

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 this tool versus the sibling 'convert_time' tool. It doesn't mention prerequisites, alternatives, or exclusions, leaving the agent to infer usage context from the tool name alone.

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/dumyCq/time-mcp'

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