Skip to main content
Glama

devtools-mcp

Convert Timestamp

convert_timestamp

时间戳双向转换,时区统一北京时间(UTC+8)。传入 Unix 时间戳(整数秒或毫秒,自动识别;也接受数字字符串)返回 ISO 8601 北京时间字符串;传入日期/时间字符串(如 2026-09-05、2026-09-05 10:30:00、2026-09-05T10:30:00+08:00)返回 Unix 秒/毫秒时间戳;不传 value 返回当前时间的两种格式。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "convert_timestamp"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNo转换方向提示,"iso"(默认,转北京时间字符串)或 "unix"(转时间戳); 实际方向按 value 类型自动判断iso
valueNoUnix 时间戳(秒/毫秒,整数或数字字符串,自动区分), 或日期时间字符串(ISO 8601、YYYY-MM-DD、YYYY/MM/DD HH:MM 等); 不传或传空字符串则返回当前北京时间

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / to / description
      Added value: +"转换方向提示,\"iso\"(默认,转北京时间字符串)或 \"unix\"(转时间戳);\n实际方向按 value 类型自动判断"
    • removedInput schema / properties / to / title
      Removed value: -"To"
    • addedInput schema / properties / value / description
      Added value: +"Unix 时间戳(秒/毫秒,整数或数字字符串,自动区分),\n   或日期时间字符串(ISO 8601、YYYY-MM-DD、YYYY/MM/DD HH:MM 等);\n   不传或传空字符串则返回当前北京时间"
    • removedInput schema / properties / value / title
      Removed value: -"Value"
    • removedInput schema / title
      Removed value: -"convert_timestampArguments"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations the description carries the full burden, and it discloses the key trait: everything is normalized to Beijing time (UTC+8). It also discloses auto-detection of seconds vs milliseconds, acceptance of numeric strings, and the no-argument default. It omits error behavior for invalid/ambiguous input, which keeps it from a 5.

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?

A single compact paragraph is front-loaded with the core behavior and contains no filler. It is dense but readable; the multiple semicolon-delimited clauses are the price of covering three input modes in one sentence.

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 two-parameter utility with an output schema, the description covers the timezone, both directions, accepted input forms, and the default-to-now case. Only invalid-input handling and timestamp range/precision limits are missing, which are minor for this tool class.

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 coverage is 100%, and the schema already documents both 'to' (a direction hint that is overridden by the value type) and 'value' (accepted formats, empty-string behavior). The description restates this with a few worked format examples but adds little meaning beyond the structured field.

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

Purpose5/5

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

The description states a specific verb and resource ('时间戳双向转换') and names the fixed timezone (Beijing, UTC+8), plus both conversion directions. It is clearly distinguishable from generic siblings like convert_unit because the resource (timestamp) and direction rules are explicit.

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

Usage Guidelines4/5

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

Usage is effectively defined by input type: pass a Unix number to get an ISO string, pass a date string to get a timestamp, pass nothing to get the current time. It does not explicitly exclude or route away from a sibling such as convert_unit, which is the only missing piece.

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.