Skip to main content
Glama

Alibaba Cloud RDS OpenAPI MCP Server

Official
by aliyun

describe_error_logs

Retrieve error logs for Alibaba Cloud RDS instances by specifying region, instance ID, time range, and pagination. Use this tool to analyze and troubleshoot database issues efficiently.

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

NameRequiredDescriptionDefault
db_instance_idYes
end_timeYes
page_numberNo
page_sizeNo
region_idYes
start_timeYes

Input Schema (JSON Schema)

{ "properties": { "db_instance_id": { "title": "Db Instance Id", "type": "string" }, "end_time": { "title": "End Time", "type": "string" }, "page_number": { "default": 1, "title": "Page Number", "type": "integer" }, "page_size": { "default": 30, "title": "Page Size", "type": "integer" }, "region_id": { "title": "Region Id", "type": "string" }, "start_time": { "title": "Start Time", "type": "string" } }, "required": [ "region_id", "db_instance_id", "start_time", "end_time" ], "title": "describe_error_logsArguments", "type": "object" }

Implementation Reference

  • The core handler function for the 'describe_error_logs' tool. It constructs a DescribeErrorLogsRequest using the provided parameters, calls the Alibaba Cloud RDS client's async method to fetch error logs, processes the response by joining the error_info fields, and returns pagination details.
    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)}")

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