Skip to main content
Glama

cls_get_log_count

Retrieve the total count of logs matching specific criteria in Tencent Cloud Log Service using CQL queries, providing faster results than full log searches for statistical analysis.

Instructions

快速获取日志数量。相比 cls_search_log 更快,适合只需要知道日志总数的场景。

参数说明

  • topic_id: 日志主题 ID(必填)。格式不固定,可能是 UUID(如 550b584b-xxxx)或自定义字符串。当用户提供的值不确定是 ID 还是名称时,优先当作 topic_id 直接使用;如果报错(如"主题不存在"),再通过 cls_describe_topics 按名称搜索获取正确的 topic_id

  • query: CQL 检索语句(必填)

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

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

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

适用场景

  • 快速确认某类日志是否存在

  • 统计特定时间范围内的日志总量

注意事项

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

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topic_idYes
queryYes
start_timeYes
end_timeYes
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 full burden and does well. It discloses important behavioral traits: performance characteristics (faster than cls_search_log), prerequisite tools (cls_convert_time for timestamp conversion, cls_describe_index for SQL preparation), and error handling guidance for topic_id. It doesn't mention rate limits or authentication needs, but covers substantial operational context.

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 emphasis (⏰, 💡) effectively. While comprehensive, it maintains focus with each sentence adding value. Some redundancy exists in parameter explanations, but overall it's efficiently organized.

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 (5 parameters, 0% schema coverage, no annotations) and presence of output schema, the description is remarkably complete. It covers purpose, usage guidelines, parameter details, prerequisite tools, error handling, and operational constraints. The output schema existence means return values don't need explanation, allowing focus on invocation 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 rich parameter semantics. It explains each parameter's purpose, format constraints (UUID or custom string for topic_id, Unix timestamp in milliseconds for time fields), optionality, and practical usage guidance including fallback strategies for topic_id resolution and region defaults.

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: '快速获取日志数量' (quickly get log count). It distinguishes from sibling cls_search_log by noting it's faster and suitable for scenarios where only the total count is needed. This provides specific verb+resource and sibling differentiation.

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 states when to use this tool ('适合只需要知道日志总数的场景' - suitable for scenarios where only total count is needed) and when to use alternatives ('相比 cls_search_log 更快' - faster than cls_search_log). It also provides specific usage scenarios like confirming log existence and counting logs in time ranges.

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