Skip to main content
Glama
tinytelly

Time MCP Server

by tinytelly

get_current_time

Retrieve the current date and time with timezone support and formatting options for accurate temporal information.

Instructions

Get the current date and time

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timezoneNoTimezone (optional, defaults to system timezone)system
formatNoTime format: "12hour", "24hour", or "iso" (default: 12hour)12hour

Implementation Reference

  • The handler logic for the 'get_current_time' tool, which retrieves the current date and time, applies optional timezone and format parameters, and returns a formatted text response.
    if (name === 'get_current_time') { const timezone = args?.timezone || 'system'; const format = args?.format || '12hour'; log('INFO', `Getting current time - timezone: ${timezone}, format: ${format}`); const now = new Date(); let timeString: string; if (timezone !== 'system') { // For specific timezone const options: Intl.DateTimeFormatOptions = { timeZone: timezone as string, year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: format === '12hour' }; timeString = now.toLocaleString('en-US', options); } else { // System timezone if (format === 'iso') { timeString = now.toISOString(); } else if (format === '24hour') { timeString = now.toLocaleString('en-US', { hour12: false }); } else { timeString = now.toLocaleString('en-US', { hour12: true }); } } const result = { content: [ { type: 'text', text: `Current time: ${timeString}`, }, ], }; log('INFO', `Returning time: ${timeString}`); return result; }
  • src/index.ts:62-82 (registration)
    Registration of the 'get_current_time' tool in the tools/list response, including its description and input schema definition.
    { name: 'get_current_time', description: 'Get the current date and time', inputSchema: { type: 'object', properties: { timezone: { type: 'string', description: 'Timezone (optional, defaults to system timezone)', default: 'system' }, format: { type: 'string', description: 'Time format: "12hour", "24hour", or "iso" (default: 12hour)', enum: ['12hour', '24hour', 'iso'], default: '12hour' } }, additionalProperties: false, }, },

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

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