Skip to main content
Glama
SergeSerb2

Time & Location MCP Server

by SergeSerb2

get_current_time

Retrieve the current date and time in your local timezone using system detection.

Instructions

Get the current date and time in your local timezone

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The switch case that handles the 'get_current_time' tool call. It formats the current date and time using the detected timezone, provides fallback formatting, and returns a JSON object with local time, timezone, ISO time, Unix timestamp, and UTC offset.
    case 'get_current_time': {
      const now = new Date();
      let localTime;
      
      try {
        localTime = new Intl.DateTimeFormat('en-US', {
          timeZone: TIMEZONE,
          year: 'numeric',
          month: '2-digit',
          day: '2-digit',
          hour: '2-digit',
          minute: '2-digit',
          second: '2-digit',
          hour12: false,
          weekday: 'long',
          timeZoneName: 'long'
        }).format(now);
      } catch (e) {
        // Fallback if timezone is invalid
        localTime = now.toString();
      }
      
      const isoString = now.toISOString();
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              current_time: localTime,
              timezone: TIMEZONE,
              iso_time: isoString,
              unix_timestamp: Math.floor(now.getTime() / 1000),
              utc_offset: new Date().getTimezoneOffset()
            }, null, 2),
          },
        ],
      };
    }
  • server.js:118-125 (registration)
    Registration of the 'get_current_time' tool in the ListTools response, specifying the name, description, and empty input schema.
    {
      name: 'get_current_time',
      description: 'Get the current date and time in your local timezone',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Input schema definition for the 'get_current_time' tool, indicating no input parameters are required.
    inputSchema: {
      type: 'object',
      properties: {},
    },
Behavior3/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 clearly indicates this is a read-only operation that returns time data, but doesn't mention potential limitations like refresh rates, system dependencies, or error conditions. It adequately describes the core behavior but lacks depth about operational constraints.

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, perfectly constructed sentence that contains all essential information with zero wasted words. It's front-loaded with the core purpose and efficiently includes the timezone specification without redundancy or fluff.

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?

For a simple zero-parameter tool with no annotations and no output schema, the description provides sufficient context about what the tool does and what it returns (date and time in local timezone). It could be slightly more complete by mentioning the return format or potential timezone detection behavior, but it's largely adequate for this complexity level.

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 with 100% schema coverage, so the baseline is 4. The description appropriately doesn't waste space discussing non-existent parameters, maintaining focus on the tool's purpose without unnecessary parameter commentary.

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 ('Get') and resource ('current date and time'), and distinguishes it from the sibling tool 'get_location' by specifying time-related functionality rather than location. It provides complete purpose information in a concise manner.

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?

The description implies usage context by specifying 'in your local timezone,' which suggests when this tool should be used versus alternatives that might provide UTC or other timezone formats. However, it doesn't explicitly mention when NOT to use it or name specific alternatives, leaving some guidance gaps.

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/SergeSerb2/time_mcp'

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