Skip to main content
Glama
Mtar786
by Mtar786

getTime

Retrieve the current server time from the Example MCP Server to synchronize applications or check system time.

Instructions

Get the current server time

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • index.js:46-51 (handler)
    The handler function for the 'getTime' tool. It generates the current date in ISO format and returns it as text content.
    async () => { const now = new Date().toISOString(); return { content: [{ type: "text", text: now }], }; }
  • Input schema for 'getTime' tool using Zod. Empty object indicates no input parameters are required.
    {},
  • index.js:42-52 (registration)
    Registration of the 'getTime' tool on the MCP server using server.tool(). Includes name, description, schema, and handler.
    server.tool( "getTime", "Get the current server time", {}, async () => { const now = new Date().toISOString(); return { content: [{ type: "text", text: now }], }; } );

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/Mtar786/mcpServer'

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