Skip to main content
Glama
drdudda-org

My Little MCP Server

by drdudda-org

get_current_time

Retrieve current date and time in Korean Standard Time (KST) with format options including locale, ISO, and timestamp for accurate timekeeping applications.

Instructions

현재 시간을 알려주는 도구입니다. 한국 시간(KST)으로 현재 날짜와 시간을 반환합니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNo시간 포맷 (기본값: locale)

Implementation Reference

  • The async handler function for the get_current_time tool. It receives the format parameter, calls the getCurrentTime helper, and returns a structured response containing the current time as text.
    async ({ format = "locale" }) => { const currentTime = getCurrentTime(format); return { content: [{ type: "text", text: `현재 시간: ${currentTime}` }] }; }
  • The input schema and metadata for the get_current_time tool, defining the optional 'format' parameter as an enum of time formats.
    { title: "현재 시간 조회", description: "현재 시간을 알려주는 도구입니다. 한국 시간(KST)으로 현재 날짜와 시간을 반환합니다.", inputSchema: { format: z.enum(["locale", "iso", "timestamp"]).optional().describe("시간 포맷 (기본값: locale)") } },
  • src/index.ts:56-74 (registration)
    The registration of the get_current_time tool using server.registerTool, including name, schema, and handler.
    server.registerTool( "get_current_time", { title: "현재 시간 조회", description: "현재 시간을 알려주는 도구입니다. 한국 시간(KST)으로 현재 날짜와 시간을 반환합니다.", inputSchema: { format: z.enum(["locale", "iso", "timestamp"]).optional().describe("시간 포맷 (기본값: locale)") } }, async ({ format = "locale" }) => { const currentTime = getCurrentTime(format); return { content: [{ type: "text", text: `현재 시간: ${currentTime}` }] }; } );
  • The helper function getCurrentTime that computes the current time (KST) in the specified format: 'locale' (Korean formatted), 'iso' (ISO-like), or 'timestamp' (Unix timestamp).
    function getCurrentTime(format: string = "locale"): string { const now = new Date(); switch (format) { case "iso": return now.toLocaleString("sv-SE", { timeZone: "Asia/Seoul" }).replace(" ", "T") + ".000Z"; case "timestamp": return now.getTime().toString(); case "locale": default: return now.toLocaleString("ko-KR", { timeZone: "Asia/Seoul", year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", weekday: "long" }); } }
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/drdudda-org/my-little-mcp'

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