Skip to main content
Glama

cls_convert_time

Convert between human-readable time expressions and Unix timestamps for CLS log and metric queries. Supports absolute dates, relative times, and timezone adjustments to ensure accurate timestamp parameters.

Instructions

时间与时间戳转换工具。在调用需要时间戳参数的 CLS 工具前,请先使用此工具进行精确转换,避免手动计算时间戳出错。

功能

  • 可读时间 → 时间戳:传入 human_readable 参数,返回对应的 Unix 毫秒时间戳和秒级时间戳

  • 时间戳 → 可读时间:传入 timestamp 参数(毫秒级),返回对应的可读时间字符串

  • 同时返回毫秒和秒级时间戳,方便直接用于日志查询(毫秒)或指标查询(秒)

参数说明

  • timestamp: Unix 毫秒时间戳(整数),与 human_readable 二选一

  • human_readable: 人类可读时间表达式(字符串),与 timestamp 二选一,支持以下格式:

    • 绝对时间: 2026-03-25 14:30:002026-03-25 14:30:00.1232026-03-25 14:302026-03-25

    • 相对时间: nowtodayyesterdaytomorrow

    • 组合格式: yesterday 12:00:00today 09:30tomorrow 08:00

    • 相对偏移: 3 hours ago1 day ago30 minutes ago2 weeks ago

  • timezone: 时区名称,默认 Asia/Shanghai

使用示例

  • 查询昨天12:00到13:00: 分别调用 human_readable="yesterday 12:00:00"human_readable="yesterday 13:00:00"

  • 查询最近1小时: 调用 human_readable="1 hour ago" 获取 start_time,human_readable="now" 获取 end_time

  • 转换时间戳: 调用 timestamp=1774396800000 查看对应的可读时间

返回格式

返回包含毫秒时间戳(用于 cls_search_log 等)、秒级时间戳(用于 cls_query_metric 等)和可读时间字符串。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timestampNo
human_readableNo
timezone_nameNoAsia/Shanghai

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/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 effectively describes the tool's behavior: it performs bidirectional conversion, returns both millisecond and second timestamps, supports multiple time formats, and has a default timezone. However, it doesn't mention error handling, rate limits, or authentication requirements, which keeps it from a perfect score.

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?

The description is well-structured with clear sections (功能, 参数说明, 使用示例, 返回格式) and uses bullet points effectively. While comprehensive, it could be slightly more concise by integrating some of the usage examples into the functional description rather than having a separate section.

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

Completeness5/5

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

Given the tool's complexity (bidirectional conversion with multiple parameter formats) and the presence of an output schema, the description is complete. It explains what the tool does, how to use it, parameter details, practical examples, and what to expect in the return values, making it fully self-contained despite the lack of annotations and schema descriptions.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by providing detailed parameter semantics. It explains that timestamp and human_readable are mutually exclusive parameters, documents the exact formats supported for human_readable (absolute time, relative time, combinations, offsets), and clarifies the purpose of the timezone parameter with its default value.

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 clearly states the tool's purpose as a time and timestamp conversion utility for CLS tools, specifying it converts between human-readable time and Unix timestamps. It distinguishes itself from sibling tools by explicitly mentioning its role in preparing parameters for tools like cls_search_log and cls_query_metric, which none of the other tools do.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool ('before calling CLS tools that require timestamp parameters') and includes practical examples showing how to use it for specific scenarios like querying yesterday's data or recent time ranges. It also mentions which sibling tools benefit from its output (cls_search_log for milliseconds, cls_query_metric for seconds).

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/Tinker-LGD2026/cls-mcp-server'

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