Skip to main content
Glama
Mtar786
by Mtar786

getTime

Retrieve the current server time using the Example MCP Server. Designed for integration with AI assistants, this tool ensures accurate time fetching for time-sensitive applications.

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 }], }; }
  • The input schema for the 'getTime' tool, which is empty as it requires no parameters.
    {},
  • index.js:42-52 (registration)
    Registration of the 'getTime' tool on the MCP server using server.tool(), specifying 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

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

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