Skip to main content
Glama
t-shiratori

Time Tools MCP Server

convert_unix_to_datetime

Convert Unix timestamps to readable date and time formats, supporting timezone adjustments and ISO formatting options.

Instructions

Convert unixtime to datetime time (e.g. 1746627290 to 2025-01-01 01:01:01)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
unixtimeYes
timezoneNo
isISONo

Implementation Reference

  • Handler function that converts a Unix timestamp to a formatted datetime string using dayjs, with optional timezone and ISO format.
    async ({ unixtime, timezone, isISO }) => {
        const currentDateTime = dayjs
            .unix(unixtime)
            .tz(getTZ(timezone))
            .format(isISO ? undefined : DEFAULT_TIME_FORMAT);
        return {
            content: [
                {
                    type: "text",
                    text: currentDateTime,
                },
            ],
        };
    },
  • Zod schema defining input parameters: unixtime (required number), timezone (optional string), isISO (optional boolean).
    {
        unixtime: z.number(),
        timezone: z.string().optional(),
        isISO: z.boolean().optional(),
    },
  • src/index.ts:47-69 (registration)
    Registration of the 'convert_unix_to_datetime' tool using server.tool, including name, description, schema, and inline handler.
    server.tool(
        "convert_unix_to_datetime",
        "Convert unixtime to datetime time (e.g. 1746627290 to 2025-01-01 01:01:01)",
        {
            unixtime: z.number(),
            timezone: z.string().optional(),
            isISO: z.boolean().optional(),
        },
        async ({ unixtime, timezone, isISO }) => {
            const currentDateTime = dayjs
                .unix(unixtime)
                .tz(getTZ(timezone))
                .format(isISO ? undefined : DEFAULT_TIME_FORMAT);
            return {
                content: [
                    {
                        type: "text",
                        text: currentDateTime,
                    },
                ],
            };
        },
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It describes the basic conversion behavior but omits key details: default timezone handling, the effect of the isISO parameter, error handling for invalid inputs, and output format specifics. For a tool with 3 parameters and no annotation coverage, this is insufficient.

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 extremely concise and front-loaded, using a single sentence with a clear example. Every word earns its place, making it easy to scan and understand the core purpose without unnecessary details.

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 complexity (3 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain the output format beyond the example, how parameters interact, or potential errors. For a conversion tool with multiple options, more context is needed to ensure correct usage.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It only mentions the unixtime parameter implicitly via the example, but provides no information about timezone (e.g., format like 'UTC' or 'America/New_York') or isISO (e.g., whether it outputs ISO 8601 format). This leaves two parameters undocumented, failing to address the coverage gap.

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 tool's function: converting Unix time to datetime format, with a specific example (1746627290 to 2025-01-01 01:01:01). It distinguishes from siblings like convert_datetime_to_unix by specifying the direction of conversion. However, it doesn't explicitly mention all siblings, so it's not a perfect 5.

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 no guidance on when to use this tool versus alternatives like get_current_date_time or get_unixtime. It lacks context about scenarios where Unix time conversion is needed, such as processing timestamps from APIs or logs. No exclusions or prerequisites are mentioned.

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/t-shiratori/time-tools-mcp-server'

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