Skip to main content
Glama

cls_query_range_metric

Query metric data over time ranges using PromQL syntax to analyze trends, monitor historical performance, and compare metrics across different periods.

Instructions

查询 CLS 指标数据(时间范围)。支持 PromQL 兼容查询语法,获取一段时间内的指标变化趋势。

参数说明

  • topic_id: 指标主题 ID(必填),注意是时序指标主题 ID,非普通日志主题 ID。格式不固定,可能是 UUID 或自定义字符串。当用户提供的值不确定是 ID 还是名称时,优先当作 topic_id 直接使用;如果报错,再通过 cls_describe_topics(biz_type=1) 按名称搜索获取正确的指标主题 ID

  • query: 指标查询语句(必填),PromQL 兼容语法

  • start_time: 起始时间,Unix 时间戳(秒)

  • end_time: 结束时间,Unix 时间戳(秒)

  • step: 步长(秒),数据点之间的间隔,默认 60

  • region: 地域(可选),如 ap-guangzhou、na-ashburn,不传则使用默认地域,可通过 cls_describe_regions 查询所有可用地域

适用场景

  • 查看指标随时间的变化趋势

  • 告警前查看历史指标走势

  • 对比不同时间段的指标数据

注意事项

  • start_time/end_time 为秒级时间戳,请先调用 cls_convert_time 工具转换,不要手动计算

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topic_idYes
queryYes
start_timeYes
end_timeYes
stepNo
regionNo

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 key behaviors: it supports PromQL-compatible query syntax, returns metric trends over time, requires specific topic_id format (time-series metric topic ID, not log topic ID), and has region defaults. It also mentions error handling for topic_id. However, it doesn't cover rate limits, authentication needs, or pagination behavior, leaving some gaps.

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 (purpose, parameters, scenarios, notes). It's appropriately sized for a 6-parameter tool with no annotations. Every sentence adds value, though the parameter section is detailed, which is necessary given the 0% schema coverage. It could be slightly more front-loaded by moving the purpose statement to the very beginning.

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 complexity (6 parameters, 0% schema coverage, no annotations, but with output schema), the description is remarkably complete. It covers purpose, all parameters with semantics, usage scenarios, critical notes, and references to sibling tools. The presence of an output schema means the description doesn't need to explain return values. This provides everything needed for effective tool selection and invocation.

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?

The schema description coverage is 0%, so the description must fully compensate. It provides detailed parameter semantics in the '参数说明' section, explaining each of the 6 parameters with purpose, format, requirements, defaults, and practical usage notes (e.g., topic_id format ambiguity resolution, time conversion requirement). This adds substantial value beyond the bare schema.

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: '查询 CLS 指标数据(时间范围)' (query CLS metric data with time range). It specifies the verb (query), resource (CLS metric data), and scope (time range). It distinguishes from sibling tools like cls_query_metric (which likely doesn't have time range) and cls_search_log (which handles logs not metrics).

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 usage guidance in the '适用场景' (applicable scenarios) section, listing three specific use cases. It also includes '注意事项' (notes) with critical instructions about time conversion, explicitly naming the alternative tool cls_convert_time. This gives clear when-to-use and when-not-to-use guidance.

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