Skip to main content
Glama
aliyun

Alibaba Cloud Observability MCP Server

Official
by aliyun

sls_diagnose_query

Diagnose and analyze SLS query issues in Alibaba Cloud Observability. Identify query correctness, performance bottlenecks, and optimization suggestions based on error messages.

Instructions

诊断SLS查询语句。

        ## 功能概述

        当 SLS 查询语句执行失败时,可以调用该工具,根据错误信息,生成诊断结果。诊断结果会包含查询语句的正确性、性能分析、优化建议等信息。

        ## 使用场景

        - 当需要诊断SLS查询语句的正确性时
        - 当 SQL 执行错误需要查找原因时

        ## 查询示例

        - "帮我诊断下 XXX 的日志查询语句"
        - "帮我分析下 XXX 的日志查询语句"

        Args:
            ctx: MCP上下文,用于访问SLS客户端
            query: SLS查询语句
            error_message: 错误信息
            project: SLS项目名称
            log_store: SLS日志库名称
            region_id: 阿里云区域ID
        

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
error_messageYeserror message
log_storeYessls log store name
projectYessls project name
queryYessls query
region_idYesaliyun region id,region id format like 'xx-xxx',like 'cn-hangzhou'
Behavior3/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 describes the tool's function (diagnosing failed queries) and output (diagnostic results with correctness, performance analysis, optimization suggestions), which is adequate for a read-only diagnostic tool. However, it lacks details about authentication requirements, rate limits, error handling, or response format specifics, leaving gaps in behavioral understanding.

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 (功能概述, 使用场景, 查询示例, Args), making it easy to scan. However, the query examples are somewhat redundant ('帮我诊断下 XXX 的日志查询语句' and '帮我分析下 XXX 的日志查询语句' are very similar), and the Args section could be more integrated with the functional explanation. Overall, it's appropriately sized but has minor inefficiencies.

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 diagnostic tool with 5 required parameters and no output schema, the description adequately covers purpose and usage but lacks details on output format, error cases, or dependencies. Without annotations, it should provide more behavioral context (e.g., what the diagnostic results look like, whether it modifies data). The absence of an output schema increases the need for description completeness, which is only partially met.

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%, providing basic descriptions for all 5 parameters. The description lists parameters in an Args section but only repeats their names without adding meaningful semantics beyond the schema. It implies that 'error_message' is used for diagnosis and 'query' is the SLS statement to analyze, but this is already evident from parameter names and schema descriptions. The baseline score of 3 reflects adequate but minimal added value.

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: '诊断SLS查询语句' (diagnose SLS query statements) when they fail, generating diagnostic results including correctness, performance analysis, and optimization suggestions. It specifies the verb ('诊断' - diagnose) and resource ('SLS查询语句' - SLS query statements), distinguishing it from siblings like sls_execute_query (executes queries) and sls_translate_natural_language_to_query (translates natural language to queries).

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: '当 SLS 查询语句执行失败时' (when SLS query statements fail to execute) and provides specific usage scenarios like diagnosing query correctness or finding causes of SQL execution errors. It implicitly distinguishes from siblings by focusing on failure diagnosis rather than execution, translation, or listing operations.

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

Related 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/aliyun/alibabacloud-observability-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server