Skip to main content
Glama
yorifuji

MCP-WTIT

by yorifuji

get_current_time

Retrieve current time with ISO8601 format, timestamp, and timezone details. Specify timezone and include milliseconds for precise time data.

Instructions

Get the current time with detailed information including ISO8601 format, timestamp, and timezone

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeMillisecondsNoInclude milliseconds in the ISO8601 format (default: true)
timezoneNoTimezone for the time (default: UTC). Examples: "UTC", "America/New_York", "Asia/Tokyo"UTC

Implementation Reference

  • Direct handler for the 'get_current_time' tool call within the MCP server, invokes the use case and formats the MCP CallToolResult.
    private async handleGetCurrentTime(args: unknown): Promise<CallToolResult> {
      const input = this.parseTimeArguments(args);
      const result = await this.dependencies.getCurrentTimeUseCase.execute(input);
    
      if (!result.success || !result.data) {
        return {
          content: [
            {
              type: 'text',
              text: `Error: ${result.error || 'Failed to get current time'}`,
            } as TextContent,
          ],
          isError: true,
        };
      }
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result.data, null, 2),
          } as TextContent,
        ],
      };
    }
  • Input schema for the 'get_current_time' tool as returned in ListTools.
      type: 'object',
      properties: {
        includeMilliseconds: {
          type: 'boolean',
          description: 'Include milliseconds in the ISO8601 format (default: true)',
          default: true,
        },
        timezone: {
          type: 'string',
          description: 'Timezone for the time (default: UTC). Examples: "UTC", "America/New_York", "Asia/Tokyo"',
          default: 'UTC',
        },
      },
    },
  • Tool registration in handleListTools method, defines name, description, and schema for 'get_current_time'.
      tools: [
        {
          name: 'get_current_time',
          description: 'Get the current time with detailed information including ISO8601 format, timestamp, and timezone',
          inputSchema: {
            type: 'object',
            properties: {
              includeMilliseconds: {
                type: 'boolean',
                description: 'Include milliseconds in the ISO8601 format (default: true)',
                default: true,
              },
              timezone: {
                type: 'string',
                description: 'Timezone for the time (default: UTC). Examples: "UTC", "America/New_York", "Asia/Tokyo"',
                default: 'UTC',
              },
            },
          },
        } as Tool,
      ],
    };
  • Application use case handler invoked by the MCP tool handler, calls the domain time service.
    export class GetCurrentTimeUseCase implements IGetCurrentTimeUseCase {
      constructor(private readonly timeService: ITimeService) {}
    
      async execute(input?: IGetCurrentTimeUseCaseInput): Promise<IGetCurrentTimeUseCaseOutput> {
        try {
          const timeData = this.timeService.getCurrentTime({
            includeMilliseconds: input?.includeMilliseconds,
            timezone: input?.timezone,
          });
    
          return {
            success: true,
            data: timeData,
          };
        } catch (error) {
          if (error instanceof TimeServiceError) {
            return {
              success: false,
              error: error.message,
            };
          }
    
          return {
            success: false,
            error: 'An unexpected error occurred while retrieving the current time',
          };
        }
      }
    }
  • Core helper function that computes and returns the current time data (ITimeData).
    getCurrentTime(options?: ITimeFormatOptions): ITimeData {
      const mergedOptions = { ...this.defaultOptions, ...options };
      const now = new Date();
      
      return {
        iso8601: this.formatToISO8601(now, mergedOptions),
        timestamp: now.getTime(),
        timezone: mergedOptions.timezone || this.getTimeZone(),
      };
    }
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. While it mentions the output format details, it doesn't describe whether this is a read-only operation, whether it has side effects, rate limits, authentication requirements, or error conditions. For a tool with zero annotation coverage, this represents a significant gap in behavioral transparency.

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

Conciseness4/5

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

The description is a single, efficient sentence that communicates the core functionality and output details. It's appropriately sized for this simple tool, though it could be slightly more structured by separating purpose from output format details.

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?

For a simple time retrieval tool with 2 optional parameters and 100% schema coverage, the description is minimally adequate. However, without annotations or an output schema, it should ideally provide more context about the return format, error handling, and behavioral characteristics to be truly complete.

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?

With 100% schema description coverage, the input schema already fully documents both parameters (includeMilliseconds and timezone) with descriptions and defaults. The tool description adds no additional parameter information beyond what's in the schema, so it meets the baseline expectation but doesn't provide extra value.

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 ('Get the current time') and specifies what information it provides ('detailed information including ISO8601 format, timestamp, and timezone'). It distinguishes itself from potential generic time tools by listing specific output details. However, without sibling tools, we cannot assess differentiation from alternatives.

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 alternatives, prerequisites, or typical use cases. It simply states what the tool does without context about when it's appropriate or what problems it solves.

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/yorifuji/mcp-wtit'

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