Skip to main content
Glama

batchGetDateByTimestamp

Convert multiple timestamps to readable dates in batch for efficient data processing.

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:43-52 (handler)
    Handler that executes the batchGetDateByTimestamp tool by invoking the helper on tsList and formatting the array of date strings as 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,
          };
    },
  • Zod input schema defining tsList as an array of numbers.
    parameters: z.object({
        tsList: z.array(z.number()),
    }),
  • index.ts:37-53 (registration)
    Registers the batchGetDateByTimestamp tool with FastMCP, including name, description, input schema, and 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,
              };
        },
    });
  • Helper function implementing the core logic: maps each timestamp to a date string using getDateByTimestamp helper.
    function batchGetDateByTimestamp(tsList: number[]) {
        return tsList.map(timestamp => getDateByTimestamp(timestamp));
    }
  • Supporting helper function that converts a single timestamp to a locale-formatted date string, used by batchGetDateByTimestamp.
    function getDateByTimestamp(ts: number) {
        return new Date(ts).toLocaleString()
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool performs a conversion, implying a read-only operation, but doesn't specify any behavioral traits such as error handling, rate limits, output format, or whether it's idempotent. The description lacks details on what happens with invalid timestamps or the structure of the returned dates, leaving significant gaps in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the core action ('batch convert') and avoids redundancy. Every part of the sentence earns its place by conveying essential information, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (batch processing with 1 parameter), no annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't explain the output format, error conditions, or how the conversion works (e.g., timezone handling). For a tool that processes multiple timestamps, more context is needed to ensure proper usage, making it inadequate for the given context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter with 0% description coverage, so the schema provides no semantic information. The description adds some value by explaining that 'tsList' is a 'list of timestamps' for 'batch convert,' but it doesn't specify the timestamp format (e.g., Unix time in seconds/milliseconds), units, or any constraints. This provides basic semantics but doesn't fully compensate for the low schema coverage, meeting the baseline for minimal parameter insight.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('batch convert') and resource ('list of timestamps to date format'), making the purpose understandable. It distinguishes from sibling 'getDateByTimestamp' by specifying batch processing, though it doesn't explicitly mention all siblings. The description is specific enough to understand what the tool does without being tautological.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides minimal guidance by stating it's 'used for processing multiple timestamps,' which implies when to use it versus single-timestamp alternatives. However, it doesn't explicitly name when to use this tool versus siblings like 'getDateByTimestamp' or 'cal,' nor does it mention any prerequisites or exclusions. The guidance is limited to an implied context without clear alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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