Skip to main content
Glama

lts__ListLogContext

Queries surrounding log entries before and after a specified log in Huawei Cloud LTS, helping you inspect event context and troubleshoot issues.

Instructions

[LTS] 查询上下文日志 该接口用于查询指定日志前(上文)后(下文)的若干条日志。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "log_group_id": "<log_group_id>",
      "log_stream_id": "<log_stream_id>",
      "project_id": "<project_id>"
    },
    "name": "lts__ListLogContext"
  }
}

Input Schema

NameRequiredDescriptionDefault
__time__No自定义时间特性时间字段,字段值需要从日志结果中获取,毫秒级时间戳。若已开启云端结构化自定义时间功能,需要使用该字段和line_num字段共同进行上下文查询。
line_numNo日志单行序列号,字段值需要从日志结果中获取,纳秒级时间戳。
project_idYes项目ID,获取方式请参见:[获取项目ID,获取账号ID,日志组ID、日志流ID](lts_api_0006.xml)
forwardsSizeNo指定起始日志往后(下文)的日志条数,取值范围 [0, 500] ,默认值100
log_group_idYes日志组ID,获取方式请参见:[获取项目ID,获取账号ID,日志组ID、日志流ID](lts_api_0006.xml)None
backwardsSizeNo指定起始日志往前(上文)的日志条数,取值范围 [0, 500] ,默认值100
log_stream_idYes日志流ID,获取方式请参见:[获取项目ID,获取账号ID,日志组ID、日志流ID](lts_api_0006.xml)None

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full disclosure burden. It does convey the core read semantics (returns the surrounding log lines of a designated entry), but says nothing about permissions, result ordering, truncation at 500 lines, or whether the anchor log itself is included – gaps that matter for a read tool with zero annotation coverage.

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?

Two short sentences, front-loaded with the tag and purpose, with no filler. The second sentence largely restates the first in slightly more detail, which is mild redundancy but not harmful.

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

Completeness3/5

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

For a seven-parameter query with no output schema and no annotations, the description covers the purpose but leaves the agent to learn the return shape, ordering, and anchoring rules from the schema alone. It is adequate but not complete for the tool's complexity.

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

Parameters3/5

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

Schema description coverage is 100%, so all seven parameters are already documented in detail, including ranges and the origin of __time__/line_num. The description only echoes the before/after concept that backwardsSize and forwardsSize already encode, adding no new parameter meaning. Baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource (query context logs) and clarifies the scope: the logs immediately before and after a designated log entry. That is clearly distinguishable from sibling listing tools such as lts__ListLogGroups or lts__ListLogStreams, though no sibling is named explicitly.

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

Usage Guidelines3/5

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

Usage is implied by the phrase '指定日志前(上文)后(下文)的若干条日志' – an agent can infer this is for drilling into the surroundings of one log line rather than listing logs broadly. However, there is no explicit when-to-use/when-not-to-use statement, no mention that a prior log query is needed to obtain __time__ and line_num, and no named alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools