Skip to main content
Glama

cls_get_log_histogram

Analyze log volume trends over time by generating histograms to detect anomalies and monitor distribution patterns in Tencent Cloud Log Service.

Instructions

获取日志数量直方图。统计指定时间范围内日志在时间维度上的分布情况,用于观察日志量趋势和异常波动。

参数说明

  • topic_id: 日志主题 ID(必填)

  • query: CQL 检索语句(必填),如 level:ERROR*(全部日志)

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

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

  • interval: 时间间隔(毫秒),系统会自动选择合适间隔,也可手动指定

适用场景

  • 观察日志量随时间的变化趋势

  • 发现某个时间段的日志突增或突降

  • 结合 cls_search_log 定位具体异常时段

注意事项

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

  • 💡 编写 SQL 分析语句前,建议先调用 cls_describe_index 获取目标主题的索引配置,确认字段名称、类型及是否开启统计,避免因字段信息不明确导致查询失败

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topic_idYes
queryYes
start_timeYes
end_timeYes
intervalNo
regionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses important behavioral traits: the tool is for statistical analysis (not destructive), requires specific time format handling (millisecond Unix timestamps), and suggests prerequisites like calling cls_convert_time for time conversion and cls_describe_index for field validation. However, it doesn't mention 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) and uses bullet points for readability. It's appropriately sized but could be slightly more concise in the notes section. Every sentence adds value, such as the warning about time conversion and suggestions for related tools.

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?

Given the complexity (6 parameters, no annotations, but has output schema), the description is mostly complete. It covers purpose, parameters, usage scenarios, and prerequisites. Since an output schema exists, it doesn't need to explain return values. However, it lacks details on error handling or performance considerations, which could be useful for a tool with multiple parameters and dependencies.

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 in the '参数说明' (Parameter explanation) section. It explains each parameter's purpose, required status, format (e.g., 'CQL 检索语句' - CQL query statement, Unix timestamp in milliseconds), and practical examples (e.g., query: 'level:ERROR' or '*'). This adds significant 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: '获取日志数量直方图。统计指定时间范围内日志在时间维度上的分布情况,用于观察日志量趋势和异常波动' (Get log count histogram. Count log distribution across time within a specified range, used to observe log volume trends and abnormal fluctuations). It specifies the verb ('获取' - get), resource ('日志数量直方图' - log count histogram), and distinguishes it from siblings like cls_search_log (for detailed logs) and cls_get_log_count (for total count).

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 explicitly provides usage guidelines in the '适用场景' (Applicable scenarios) section: observing log volume trends over time, detecting sudden increases or decreases, and combining with cls_search_log to locate specific abnormal periods. It also mentions when not to use it (e.g., for detailed logs, use cls_search_log instead). This gives clear context for when to choose this tool over alternatives.

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