Skip to main content
Glama

cls_query_metric

Query single-point metric data from Tencent Cloud Log Service using PromQL-compatible syntax to retrieve specific timestamp values for monitoring and analysis.

Instructions

查询 CLS 指标数据(单时间点)。支持 PromQL 兼容查询语法,获取某一时刻的指标值。

参数说明

  • topic_id: 指标主题 ID(必填),注意是时序指标主题 ID,非普通日志主题 ID

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

  • time: 查询时间点,Unix 时间戳(秒),默认当前时间

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

PromQL 示例

  • metric_name — 查询单个指标当前值

  • rate(metric_name[5m]) — 5 分钟速率

  • sum(metric_name) by (label) — 按标签汇总

  • topk(5, metric_name) — 取 Top 5

注意事项

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topic_idYes
queryYes
timeNo
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 behavioral traits: the tool queries metric data (not logs), supports PromQL-compatible syntax, returns values at a specific time point, and has region-specific behavior. It also provides important operational guidance about time conversion. The only minor gap is lack of explicit mention about authentication or rate limits.

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, examples, notes) and efficiently conveys necessary information. Every sentence adds value, though the PromQL examples section could be slightly more concise. The structure is front-loaded with the core purpose, followed by detailed supporting information.

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 (metric querying with PromQL), 0% schema coverage, no annotations, but with an output schema present, the description provides excellent completeness. It covers purpose, parameters with semantics, usage examples, important operational notes, and references to related tools. The output schema existence means the description doesn't need to explain return values, allowing it to focus on usage context.

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 comprehensive parameter semantics. It explains all four parameters in detail: topic_id (required metric topic ID, not log topic), query (required PromQL syntax), time (optional Unix timestamp in seconds, default current time), and region (optional, with examples). It also provides PromQL examples that clarify the query parameter usage beyond basic schema information.

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 at a single time point). It specifies the verb '查询' (query) and resource 'CLS 指标数据' (CLS metric data), and distinguishes it from sibling tools like cls_query_range_metric by emphasizing '单时间点' (single time point). This provides specific differentiation from alternatives.

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. It states when to use this tool (for single-time-point metric queries with PromQL syntax) and when not to (implied by distinguishing from range queries). It also names alternatives: cls_convert_time for time conversion and cls_describe_regions for region lookup, creating clear contextual boundaries.

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