Skip to main content
Glama

batchGetDateByTimestamp

Convert a list of timestamps into readable date formats for efficient processing and analysis of multiple time-based data points.

Instructions

Batch convert the provided list of timestamps to date format, used for processing multiple timestamps

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tsListYes

Implementation Reference

  • index.ts:37-53 (registration)
    Registration of the batchGetDateByTimestamp tool with FastMCP server, including name, description, schema, and execute handler.
    server.addTool({ name: "batchGetDateByTimestamp", description: "Batch convert the provided list of timestamps to date format, used for processing multiple timestamps", parameters: z.object({ tsList: z.array(z.number()), }), execute: async (args) => { let result = batchGetDateByTimestamp(args.tsList); let ct: TextContent[] = result.map(item => ({ type: "text", text: item })) return { content: ct, }; }, });
  • Zod input schema for the tool: requires tsList as an array of numbers.
    parameters: z.object({ tsList: z.array(z.number()), }),
  • index.ts:43-52 (handler)
    The tool's execute handler: calls the batchGetDateByTimestamp helper on input tsList, maps results to TextContent array for MCP response.
    execute: async (args) => { let result = batchGetDateByTimestamp(args.tsList); let ct: TextContent[] = result.map(item => ({ type: "text", text: item })) return { content: ct, }; },
  • Helper function implementing the core batch conversion logic: maps each timestamp to a date string via getDateByTimestamp.
    function batchGetDateByTimestamp(tsList: number[]) { return tsList.map(timestamp => getDateByTimestamp(timestamp)); }
  • Supporting utility function: converts a single timestamp to localized date string, used by batchGetDateByTimestamp.
    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