Skip to main content
Glama
aliyun

Alibaba Cloud Observability MCP Server

Official
by aliyun

arms_generate_trace_query

Converts natural language queries into ARMS trace query statements for analyzing application performance and execution paths in Alibaba Cloud.

Instructions

生成ARMS应用的调用链查询语句。

        ## 功能概述

        该工具用于将自然语言描述转换为ARMS调用链查询语句,便于分析应用性能和问题。

        ## 使用场景

        - 当需要查询应用的调用链信息时
        - 当需要分析应用性能问题时
        - 当需要跟踪特定请求的执行路径时
        - 当需要分析服务间调用关系时

        ## 查询处理

        工具会将自然语言问题转换为SLS查询,并返回:
        - 生成的SLS查询语句
        - 存储调用链数据的项目名
        - 存储调用链数据的日志库名

        ## 查询上下文

        查询会考虑以下信息:
        - 应用的PID
        - 响应时间以纳秒存储,需转换为毫秒
        - 数据以span记录存储,查询耗时需要对符合条件的span进行求和
        - 服务相关信息使用serviceName字段
        - 如果用户明确提出要查询 trace信息,则需要在查询问题上question 上添加说明返回trace信息

        ## 查询示例

        - "帮我查询下 XXX 的 trace 信息"
        - "分析最近一小时内响应时间超过1秒的调用链"

        Args:
            ctx: MCP上下文,用于访问ARMS和SLS客户端
            user_id: 用户阿里云账号ID
            pid: 应用的PID
            region_id: 阿里云区域ID
            question: 查询调用链的自然语言问题

        Returns:
            包含查询信息的字典,包括sls_query、project和log_store
        

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYespid,the pid of the app
questionYesquestion,the question to query the trace
region_idYesregion id,region id format like 'xx-xxx',like 'cn-hangzhou'
user_idYesuser aliyun account id
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 what the tool does (converts natural language to SLS queries), what it returns (generated SLS query, project name, log store name), and important contextual behaviors like response time conversion from nanoseconds to milliseconds and handling of trace-specific queries. The main gap is lack of information about error conditions 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.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (功能概述, 使用场景, 查询处理, 查询上下文, 查询示例, Args, Returns), but it's quite verbose at approximately 400 Chinese characters. Some sections like the detailed query context could be more concise while maintaining clarity.

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?

For a tool with 4 parameters, 100% schema coverage, but no annotations or output schema, the description provides substantial contextual information. It explains the transformation process, return format, query considerations, and includes examples. The main gap is the lack of output schema documentation, but the Returns section partially compensates for this.

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 the schema already documents all four parameters. The description's Args section restates the parameter names but doesn't add significant semantic value beyond what's in the schema. However, it does provide useful context about how 'question' parameters should be formulated with natural language queries.

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 explicitly states the tool's purpose as '将自然语言描述转换为ARMS调用链查询语句' (converting natural language descriptions to ARMS trace query statements), which is a specific verb+resource combination. It clearly distinguishes this from sibling tools like 'sls_translate_natural_language_to_query' by focusing specifically on ARMS application trace queries rather than general SLS 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 '使用场景' section provides four explicit scenarios for when to use this tool, including querying trace information, analyzing performance problems, tracking specific request execution paths, and analyzing service call relationships. This gives clear guidance on appropriate usage contexts without needing to reference specific 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

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