Skip to main content
Glama

getDateByTimestamp

Transform numeric timestamps into readable date formats using this tool on Cal Server, simplifying time-based data conversion.

Instructions

Convert the provided timestamp to date format

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tsYes

Implementation Reference

  • index.ts:32-34 (handler)
    Handler function that executes the tool logic by calling getDateByTimestamp on the input ts and returning it as a string.
    execute: async (args) => { return String(getDateByTimestamp(args.ts)); },
  • Zod schema defining the input parameter 'ts' as a number.
    parameters: z.object({ ts: z.number(), }),
  • index.ts:26-35 (registration)
    Registration of the 'getDateByTimestamp' tool with FastMCP server, including name, description, schema, and handler.
    server.addTool({ name: "getDateByTimestamp", description: "Convert the provided timestamp to date format", parameters: z.object({ ts: z.number(), }), execute: async (args) => { return String(getDateByTimestamp(args.ts)); }, });
  • Helper function implementing the core logic: converts a Unix timestamp (number) to a locale-formatted date string.
    function getDateByTimestamp(ts: number) { return new Date(ts).toLocaleString() }

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/pwh-pwh/cal-mcp'

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