Skip to main content
Glama

时间戳转换

timestamp_convert
Read-onlyIdempotent

秒级 Unix 时间戳与日期时间互转,可指定时区(默认 Asia/Shanghai)。用于把时间戳转可读日期或日期转时间戳。Example: {"mode":"to_date","value":1700000000,"timezone":"Asia/Shanghai"}

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "mode": "to_date",
      "value": 1700000000,
      "timezone": "Asia/Shanghai"
    },
    "name": "timestamp_convert"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoto_date=时间戳转日期;to_ts=日期转时间戳to_date
valueYes秒级时间戳或日期 YYYY-MM-DD
timezoneNo时区,默认 Asia/ShanghaiAsia/Shanghai

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / mode / description
      Previous value: -"转换方向:to_date 时间戳转日期 / to_ts 日期转时间戳,默认 to_date"New value: +"to_date=时间戳转日期;to_ts=日期转时间戳"
    • changedInput schema / properties / timezone / description
      Previous value: -"IANA 时区名,默认 Asia/Shanghai"New value: +"时区,默认 Asia/Shanghai"
    • changedInput schema / properties / value / description
      Previous value: -"秒级时间戳(数字,to_date 时)或日期字符串 YYYY-MM-DD(to_ts 时),如 1700000000 或 2026-01-01"New value: +"秒级时间戳或日期 YYYY-MM-DD"
  2. Added

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the safety profile is covered. The description restates the default timezone and the second-level precision, both of which are already present in the schema property descriptions, and discloses nothing about the returned format or error behavior (e.g. invalid date input).

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

Conciseness4/5

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

Front-loaded with the core conversion capability and timezone default in one sentence, with the purpose clause second. The inline Example duplicates the schema's examples field exactly, which is mild redundancy but does no harm.

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

Completeness4/5

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

For a 3-parameter, single-purpose conversion utility with full schema coverage and complete read-only annotations, the description covers directionality, units and timezone. The only gap is that no output schema exists and the description does not state what the returned string looks like for each mode.

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?

Schema description coverage is 100%: mode enum values, value format, and timezone default are all documented in the schema. The description only echoes the default timezone and repeats the example already present in the schema's examples array, adding no meaning beyond structured data. Baseline 3 applies.

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?

States a specific verb+resource: bidirectional conversion between second-level Unix timestamps and human-readable datetimes, with a named timezone dimension. The directionality (both ways) is clear and distinguishes it implicitly from siblings like time_now or world_time, though no sibling is named.

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

Usage Guidelines3/5

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

The clause '用于把时间戳转可读日期或日期转时间戳' implies the use case, but there is no guidance on when to prefer time_now / world_time instead, nor any stated preconditions or exclusions. Usage is implied rather than directed.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.