Skip to main content
Glama
arjshiv

Local Utilities MCP Server

by arjshiv

get_time_and_date

Retrieve the current time, date, day of the week, and timestamp in multiple formats for system monitoring or data synchronization tasks using a Local Utilities MCP Server tool.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The inline handler function for the get_time_and_date tool, which retrieves time data via helper and returns formatted JSON text content.
    async () => { const result = getCurrentTimeAndDate(); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; }
  • Core helper function that calculates and returns the current time, date, day of week, ISO string, and Unix 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(), }; }
  • TypeScript interface specifying the structure of the time and date response object.
    interface ITimeResponse { time: string; date: string; dayOfWeek: string; iso: string; timestamp: number; }
  • src/mcp/time.ts:24-38 (registration)
    Registration function for the get_time_and_date tool, including the tool name, description, and 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) }] }; } ); }
  • src/index.ts:24-24 (registration)
    Call to register the time tool on the main MCP server instance.
    registerTimeTool(server);

Other Tools

Related 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