Skip to main content
Glama
dh1789

My First MCP

by dh1789

get_current_time

Retrieve current date and time with optional timezone specification and output format customization (full, date-only, or time-only).

Instructions

현재 날짜와 시간을 반환합니다. 시간대를 지정할 수 있습니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timezoneNo시간대 (예: Asia/Seoul, America/New_York). 기본값: Asia/Seoul
formatNo출력 형식: full(전체), date(날짜만), time(시간만). 기본값: full

Implementation Reference

  • Handler function that executes the get_current_time tool: gets current date, formats it using the formatTime helper with optional timezone and format parameters, and returns a text content block with the result.
    async ({ timezone, format }) => {
      const result = formatTime(
        new Date(),
        timezone || "Asia/Seoul",
        (format || "full") as TimeFormat
      );
    
      return {
        content: [
          {
            type: "text",
            text: `현재 시간 (${result.timezone}): ${result.formatted}`,
          },
        ],
      };
    }
  • Input schema for get_current_time tool defined using Zod: optional timezone (string) and format (enum: full/date/time).
    {
      timezone: z
        .string()
        .optional()
        .describe("시간대 (예: Asia/Seoul, America/New_York). 기본값: Asia/Seoul"),
      format: z
        .enum(["full", "date", "time"])
        .optional()
        .describe("출력 형식: full(전체), date(날짜만), time(시간만). 기본값: full"),
    },
  • src/index.ts:81-110 (registration)
    Registration of the get_current_time tool using server.tool(), including description, input schema, and inline handler function.
    server.tool(
      "get_current_time",
      "현재 날짜와 시간을 반환합니다. 시간대를 지정할 수 있습니다.",
      {
        timezone: z
          .string()
          .optional()
          .describe("시간대 (예: Asia/Seoul, America/New_York). 기본값: Asia/Seoul"),
        format: z
          .enum(["full", "date", "time"])
          .optional()
          .describe("출력 형식: full(전체), date(날짜만), time(시간만). 기본값: full"),
      },
      async ({ timezone, format }) => {
        const result = formatTime(
          new Date(),
          timezone || "Asia/Seoul",
          (format || "full") as TimeFormat
        );
    
        return {
          content: [
            {
              type: "text",
              text: `현재 시간 (${result.timezone}): ${result.formatted}`,
            },
          ],
        };
      }
    );
  • Pure helper function formatTime that performs the core time formatting logic using Intl.DateTimeFormat for Korean locale, supporting different formats and timezones. Used by the get_current_time handler.
    export function formatTime(
      date: Date,
      timezone: string = "Asia/Seoul",
      format: TimeFormat = "full"
    ): TimeResult {
      let options: Intl.DateTimeFormatOptions = { timeZone: timezone };
    
      switch (format) {
        case "date":
          options = { ...options, dateStyle: "full" };
          break;
        case "time":
          options = { ...options, timeStyle: "long" };
          break;
        case "full":
        default:
          options = { ...options, dateStyle: "full", timeStyle: "long" };
          break;
      }
    
      const formatted = date.toLocaleString("ko-KR", options);
      return { formatted, timezone };
    }
  • TypeScript type definitions for TimeFormat enum and TimeResult interface used in get_current_time implementation.
    export type TimeFormat = "full" | "date" | "time";
    
    export interface TimeResult {
      formatted: string;
      timezone: string;
    }
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 adds some context by mentioning timezone specification and output format options, but lacks details on rate limits, authentication needs, or error handling. It doesn't contradict annotations (none exist), but it's minimally adequate for a simple read operation.

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 extremely concise and front-loaded: two sentences that directly state the tool's function and key capability. Every word earns its place with no wasted text, making it easy for an AI agent to parse quickly.

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?

Given the tool's low complexity (simple read operation with 2 optional parameters) and 100% schema coverage, the description is somewhat complete but lacks output details (no output schema exists). It covers the basic purpose and parameters but doesn't explain return values or potential behavioral aspects, leaving room for improvement.

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?

Schema description coverage is 100%, so the schema already fully documents both parameters (timezone and format). The description adds minimal value by mentioning timezone specification but doesn't provide additional syntax or format details beyond what the schema offers. This meets the baseline for high schema coverage.

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: '현재 날짜와 시간을 반환합니다' (returns current date and time). It specifies the verb (returns) and resource (current date and time), making the function unambiguous. However, it doesn't differentiate from siblings like 'get_server_info' or 'server_status' that might also provide time-related data, preventing a perfect score.

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. It mentions timezone specification but doesn't clarify scenarios where this is necessary or compare it to sibling tools that might offer similar functionality. There's no explicit when/when-not usage or alternative recommendations.

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/dh1789/my-first-mcp'

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