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
| Name | Required | Description | Default |
|---|---|---|---|
| ts | Yes |
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)); },
- index.ts:29-31 (schema)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)); }, });
- index.ts:71-73 (helper)Helper function implementing the core logic: converts timestamp to localized date string.function getDateByTimestamp(ts: number) { return new Date(ts).toLocaleString() }