Skip to main content
Glama
arjshiv

Local Utilities MCP Server

by arjshiv

get_time_and_date

Returns the current local time, date, day of week, and timestamp in multiple formats for system time access.

Instructions

Returns the current time, date, day of week, and timestamp in various formats

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/mcp/time.ts:24-38 (registration)
    Registration of the 'get_time_and_date' tool via server.tool() with a description and async handler.
    export function registerTimeTool(server: McpServer) {
      server.tool(
        "get_time_and_date",
        "Returns the current time, date, day of week, and timestamp in various formats",
        async () => {
          const result = getCurrentTimeAndDate();
          return {
            content: [{
              type: "text",
              text: JSON.stringify(result, null, 2)
            }]
          };
        }
      );
    } 
  • Core handler function getCurrentTimeAndDate() that creates a Date object and returns time, date, dayOfWeek, ISO string, and timestamp.
    export function getCurrentTimeAndDate(): ITimeResponse {
      const now = new Date();
      const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
      
      return {
        time: now.toLocaleTimeString(),
        date: now.toLocaleDateString(),
        dayOfWeek: days[now.getDay()],
        iso: now.toISOString(),
        timestamp: now.getTime(),
      };
    }
  • ITimeResponse interface defining the shape of the tool's output (time, date, dayOfWeek, iso, timestamp).
    interface ITimeResponse {
      time: string;
      date: string;
      dayOfWeek: string;
      iso: string;
      timestamp: number;
    }
  • src/index.ts:9-9 (registration)
    Import of registerTimeTool in the main entry point.
    import { registerTimeTool } from "./mcp/time.js";
  • src/index.ts:24-24 (registration)
    Call to registerTimeTool(server) that wires the tool into the MCP server.
    registerTimeTool(server);
Behavior3/5

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

No annotations are provided, so the description bears full responsibility. It discloses that the tool returns multiple pieces of data but does not specify the exact formats or whether the result is a single object or separate values. For a simple read-only tool, this is adequate but could be more precise.

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, clear sentence that conveys all necessary information without any wasted words. It is well-structured and front-loaded.

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

Completeness4/5

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

Given the tool has no parameters and no output schema, the description provides a good overview of what is returned. However, it could be improved by specifying the return format (e.g., JSON object) or listing the exact formats. Despite this, it is sufficient for a simple tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and the input schema is fully covered (100%). Following the guidelines, a baseline score of 4 is appropriate since the description adds no param information, but none is needed. The description implicitly confirms no inputs required.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns current time, date, day of week, and timestamp in various formats. It uses a specific verb ('Returns') and resource ('current time, date...') and distinguishes itself from sibling tools that provide other system information.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explicitly state when to use this tool versus alternatives like get_hostname or get_public_ip. However, the purpose is self-explanatory, so usage is implied. No exclusions or context are provided.

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/arjshiv/localutils-mcp-server'

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