Skip to main content
Glama

getDateByTimestamp

Convert timestamps to readable date formats for data analysis and system integration tasks.

Instructions

Convert the provided timestamp to date format

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tsYes

Implementation Reference

  • index.ts:32-34 (handler)
    Handler that executes the tool by calling getDateByTimestamp on the input ts and returning it as a string.
    execute: async (args) => { return String(getDateByTimestamp(args.ts)); },
  • Input schema defining the 'ts' parameter as a number.
    parameters: z.object({ ts: z.number(), }),
  • index.ts:26-35 (registration)
    Registration of the 'getDateByTimestamp' tool with FastMCP server.
    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 timestamp to localized date string.
    function getDateByTimestamp(ts: number) { return new Date(ts).toLocaleString() }

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