Skip to main content
Glama
tinytelly

Time MCP Server

by tinytelly

get_time_info

Retrieve current time details like timezone and day of week for accurate time-related queries across different locations.

Instructions

Get detailed time information including timezone, day of week, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timezoneNoTimezone (optional, defaults to system timezone)system

Implementation Reference

  • Handler implementation for the 'get_time_info' tool. Extracts timezone from arguments (defaults to 'system'), computes detailed time information using Date object and Intl.DateTimeFormat for specific timezones, handles errors for invalid timezones, and returns a structured text response with JSON-formatted time info.
    if (name === 'get_time_info') {
      const timezone = args?.timezone || 'system';
      log('INFO', `Getting detailed time info - timezone: ${timezone}`);
      
      const now = new Date();
    
      let timeInfo: any = {
        timestamp: now.getTime(),
        iso_string: now.toISOString(),
        local_time: now.toLocaleString(),
        day_of_week: now.toLocaleDateString('en-US', { weekday: 'long' }),
        date: now.toLocaleDateString('en-US'),
        year: now.getFullYear(),
        month: now.getMonth() + 1,
        day: now.getDate(),
        hour: now.getHours(),
        minute: now.getMinutes(),
        second: now.getSeconds(),
        timezone_offset: now.getTimezoneOffset(),
      };
    
      if (timezone !== 'system') {
        try {
          const tzFormatter = new Intl.DateTimeFormat('en-US', {
            timeZone: timezone as string,
            year: 'numeric',
            month: '2-digit',
            day: '2-digit',
            hour: '2-digit',
            minute: '2-digit',
            second: '2-digit',
            timeZoneName: 'short'
          });
          timeInfo.timezone_time = tzFormatter.format(now);
          timeInfo.requested_timezone = timezone;
        } catch (error) {
          timeInfo.timezone_error = `Invalid timezone: ${timezone}`;
        }
      }
    
      const result = {
        content: [
          {
            type: 'text',
            text: JSON.stringify(timeInfo, null, 2),
          },
        ],
      };
      
      log('INFO', 'Returning detailed time info');
      return result;
    }
  • Schema definition for the 'get_time_info' tool returned in tools/list response, including name, description, and inputSchema with optional 'timezone' string parameter.
    {
      name: 'get_time_info',
      description: 'Get detailed time information including timezone, day of week, etc.',
      inputSchema: {
        type: 'object',
        properties: {
          timezone: {
            type: 'string',
            description: 'Timezone (optional, defaults to system timezone)',
            default: 'system'
          }
        },
        additionalProperties: false,
      },
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions what information is returned but does not disclose behavioral traits such as whether it's a read-only operation, error handling, or performance characteristics. The description is minimal and lacks critical context for a tool with no annotation coverage.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, with every part contributing to clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It does not explain what 'detailed time information' includes beyond examples, nor does it cover return values or potential errors. For a tool with no structured support, more context is needed to be fully helpful.

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?

The schema description coverage is 100%, with the single parameter 'timezone' well-documented in the schema. The description does not add any parameter-specific details beyond what the schema provides, so it meets the baseline for high schema coverage without compensating with extra semantics.

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 verb 'Get' and the resource 'detailed time information', specifying what information is included (timezone, day of week, etc.). It distinguishes itself from the sibling 'get_current_time' by implying more comprehensive data, though not explicitly contrasting them.

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 the sibling 'get_current_time', nor does it mention any prerequisites or exclusions. Usage is implied by the name and description but not explicitly stated.

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

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