Skip to main content
Glama

getCurrentTimestamp

Retrieve the current local timestamp in seconds or milliseconds for precise time synchronization or logging in the Whistle MCP Server environment.

Instructions

获取当前本地时间戳

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The execute handler for the getCurrentTimestamp tool, which returns the current Unix timestamp in milliseconds using Date.now(), wrapped in the standard response format.
    execute: async () => { const timestamp = Date.now(); return formatResponse({ timestamp }); },
  • src/index.ts:454-462 (registration)
    Registration of the getCurrentTimestamp tool using server.addTool, including name, description, empty Zod input schema, and inline handler function.
    server.addTool({ name: "getCurrentTimestamp", description: "获取当前本地时间戳", parameters: z.object({}), execute: async () => { const timestamp = Date.now(); return formatResponse({ timestamp }); }, });
  • Shared helper function that formats tool outputs into the MCP-standard content array with JSON-stringified text payload. Used by getCurrentTimestamp and all other tools.
    function formatResponse(data: any) { return { content: [ { type: "text" as const, text: JSON.stringify(data), }, ], }; }

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/7gugu/whistle-mcp'

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