Skip to main content
Glama
aliyun

Alibaba Cloud RDS OpenAPI MCP Server

Official
by aliyun

describe_error_logs

Read-only

Query error logs for Alibaba Cloud RDS instances to diagnose database issues by specifying time range and instance details.

Instructions

Query error logs of an RDS instance.
Args:
    region_id: The region ID of the RDS instance.
    db_instance_id: The ID of the RDS instance.
    start_time: The start time of the query. Format: yyyy-MM-dd HH:mm.
    end_time: The end time of the query. Format: yyyy-MM-dd HH:mm.
    page_size: The number of records per page. Range: 30~100. Default: 30.
    page_number: The page number. Default: 1.
Returns:
    Dict[str, Any]: A dictionary containing error log information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
region_idYes
db_instance_idYes
start_timeYes
end_timeYes
page_sizeNo
page_numberNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • This is the main handler function for the 'describe_error_logs' tool. It queries error logs from Alibaba Cloud RDS using the DescribeErrorLogs API, processes the response to extract log information, and returns formatted results including logs and pagination details.
    @mcp.tool(annotations=READ_ONLY_TOOL)
    async def describe_error_logs(
            region_id: str,
            db_instance_id: str,
            start_time: str,
            end_time: str,
            page_size: int = 30,
            page_number: int = 1
    ) -> Dict[str, Any]:
        """
        Query error logs of an RDS instance.
        Args:
            region_id: The region ID of the RDS instance.
            db_instance_id: The ID of the RDS instance.
            start_time: The start time of the query. Format: yyyy-MM-dd HH:mm.
            end_time: The end time of the query. Format: yyyy-MM-dd HH:mm.
            page_size: The number of records per page. Range: 30~100. Default: 30.
            page_number: The page number. Default: 1.
        Returns:
            Dict[str, Any]: A dictionary containing error log information
        """
        try:
            start_time = transform_to_datetime(start_time)
            end_time = transform_to_datetime(end_time)
            client = get_rds_client(region_id)
            request = rds_20140815_models.DescribeErrorLogsRequest(
                dbinstance_id=db_instance_id,
                start_time=transform_to_iso_8601(start_time, "minutes"),
                end_time=transform_to_iso_8601(end_time, "minutes"),
                page_size=page_size,
                page_number=page_number
            )
            response = await client.describe_error_logs_async(request)
            return {
                "Logs": "\n".join([log.error_info for log in response.body.items.error_log]),
                "PageNumber": response.body.page_number,
                "PageRecordCount": response.body.page_record_count,
                "TotalRecordCount": response.body.total_record_count
            }
        except Exception as e:
            logger.error(f"Failed to describe error logs: {str(e)}")
            raise OpenAPIError(f"Failed to describe error logs: {str(e)}")
Behavior3/5

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

The annotations declare readOnlyHint=true, which the description doesn't contradict (it uses 'Query,' consistent with read-only). The description adds value by specifying the return type as 'A dictionary containing error log information,' which isn't covered by annotations. However, it lacks details on rate limits, authentication needs, or pagination behavior beyond parameter descriptions, leaving some behavioral 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 for purpose, args, and returns. It's front-loaded with the main purpose and efficiently details parameters without unnecessary fluff. However, the 'Args:' and 'Returns:' labels could be slightly more concise, but overall, it's appropriately sized and informative.

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 tool's complexity (6 parameters, read-only operation) and the presence of an output schema, the description is reasonably complete. It covers parameter semantics thoroughly and hints at the return structure. With annotations handling safety and an output schema likely detailing the dictionary, the description provides adequate context, though it could benefit from more behavioral details like error handling.

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 semantics for all 6 parameters. It explains each parameter's purpose, includes format specifications for time fields, and notes ranges and defaults for pagination parameters. This adds significant value beyond the bare schema, making parameter usage clear.

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 clearly states the tool's purpose as 'Query error logs of an RDS instance,' which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like describe_slow_log_records or describe_sql_insight_statistic, which also query logs/performance data. The purpose is clear but lacks 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 Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when this tool is appropriate (e.g., for debugging errors) or when other tools like describe_slow_log_records might be better. There's no context about prerequisites or exclusions, leaving the agent with minimal usage guidance.

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/aliyun/alibabacloud-rds-openapi-mcp-server'

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