Skip to main content
Glama
Rootly-AI-Labs

Rootly MCP server

Official

listAlerts

Retrieve and manage alerts by querying the Rootly MCP server with parameters like page size and number, enabling efficient incident monitoring and response.

Instructions

List alerts

Query Parameters:

  • include: No description.

  • page_number: No description.

  • page_size: No description.

Responses:

  • 200 (Success): success

    • Content-Type: application/vnd.api+json

    • Example:

{
  "key": "value"
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeNo
page_numberNo
page_sizeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registers the filtered OpenAPI specification as MCP tools using FastMCP.from_openapi, automatically generating the "listAlerts" tool corresponding to the GET /v1/alerts endpoint with operationId "listAlerts".
    mcp = FastMCP.from_openapi(
        openapi_spec=filtered_spec,
        client=http_client.client,
        name=name,
        timeout=30.0,
        tags={"rootly", "incident-management"},
    )
  • Modifies the OpenAPI schema for alert endpoints (including /alerts for listAlerts) by adding pagination parameters (page[size], page[number]), sparse fields[alerts] with essential fields, and include parameter to optimize payloads and prevent large responses.
    # Add sparse fieldsets for alerts endpoints to reduce payload size
    if "alert" in path.lower():
        # Add fields[alerts] parameter with essential fields only - make it required with default
        operation["parameters"].append({
            "name": "fields[alerts]",
            "in": "query",
            "required": True,
            "schema": {
                "type": "string",
                "default": "id,summary,status,started_at,ended_at,short_id,alert_urgency_id,source,noise",
                "description": "Comma-separated list of alert fields to include (reduces payload size)"
            }
        })
    
    # Add include parameter for alerts endpoints to minimize relationships
    if "alert" in path.lower():
        # Check if include parameter already exists
        include_param_exists = any(param.get("name") == "include" for param in operation["parameters"])
        if not include_param_exists:
            operation["parameters"].append({
                "name": "include",
                "in": "query",
                "required": True,
                "schema": {
                    "type": "string",
                    "default": "",
                    "description": "Related resources to include (empty for minimal payload)"
                }
            })
    
    # Add sparse fieldsets for incidents endpoints to reduce payload size
    if "incident" in path.lower():
        # Add fields[incidents] parameter with essential fields only - make it required with default
        operation["parameters"].append({
            "name": "fields[incidents]", 
            "in": "query",
            "required": True,
            "schema": {
                "type": "string",
                "default": "id,title,summary,status,severity,created_at,updated_at,url,started_at",
                "description": "Comma-separated list of incident fields to include (reduces payload size)"
            }
        })
  • Defines the default list of allowed API paths, explicitly including "/alerts" which enables inclusion of the listAlerts tool in the filtered OpenAPI spec.
    DEFAULT_ALLOWED_PATHS = [
        "/incidents/{incident_id}/alerts",
        "/alerts",
        "/alerts/{alert_id}",
        "/severities",
        "/severities/{severity_id}",
        "/teams",
        "/teams/{team_id}",
        "/services",
        "/services/{service_id}",
        "/functionalities",
        "/functionalities/{functionality_id}",
        # Incident types
        "/incident_types",
        "/incident_types/{incident_type_id}",
        # Action items (all, by id, by incident)
        "/incident_action_items",
        "/incident_action_items/{incident_action_item_id}",
        "/incidents/{incident_id}/action_items",
        # Workflows
        "/workflows",
        "/workflows/{workflow_id}",
        # Workflow runs
        "/workflow_runs",
        "/workflow_runs/{workflow_run_id}",
        # Environments
        "/environments",
        "/environments/{environment_id}",
        # Users
        "/users",
        "/users/{user_id}",
        "/users/me",
        # Status pages
        "/status_pages",
        "/status_pages/{status_page_id}",
        # On-call schedules and shifts
        "/schedules",
        "/schedules/{schedule_id}",
        "/schedules/{schedule_id}/shifts",
        "/shifts",
        "/schedule_rotations/{schedule_rotation_id}",
        "/schedule_rotations/{schedule_rotation_id}/schedule_rotation_users",
        "/schedule_rotations/{schedule_rotation_id}/schedule_rotation_active_days",
        # On-call overrides
        "/schedules/{schedule_id}/override_shifts",
        "/override_shifts/{override_shift_id}",
        # On-call shadows and roles
        "/schedules/{schedule_id}/on_call_shadows",
        "/on_call_shadows/{on_call_shadow_id}",
        "/on_call_roles",
        "/on_call_roles/{on_call_role_id}",
    ]
  • The core request handler in AuthenticatedHTTPXClient used by all generated OpenAPI tools, including listAlerts. Transforms sanitized MCP parameters back to original API parameter names and proxies the HTTP request to the Rootly API (GET /v1/alerts).
    async def request(self, method: str, url: str, **kwargs):
        """Override request to transform parameters."""
        # Transform query parameters
        if 'params' in kwargs:
            kwargs['params'] = self._transform_params(kwargs['params'])
    
        # Call the underlying client's request method and let it handle everything
        return await self.client.request(method, url, **kwargs)
  • Sanitizes all parameter names in the OpenAPI spec to comply with MCP naming rules (e.g., page[size] -> page_size), used for listAlerts parameters. Returns mapping for parameter transformation during execution.
    def sanitize_parameters_in_spec(spec: Dict[str, Any]) -> Dict[str, str]:
        """
        Sanitize all parameter names in an OpenAPI specification.
        
        This function modifies the spec in-place and builds a mapping 
        of sanitized names to original names.
        
        Args:
            spec: OpenAPI specification dictionary
            
        Returns:
            Dictionary mapping sanitized names to original names
        """
        parameter_mapping = {}
        
        # Sanitize parameters in paths
        if "paths" in spec:
            for path, path_item in spec["paths"].items():
                if not isinstance(path_item, dict):
                    continue
                    
                # Sanitize path-level parameters
                if "parameters" in path_item:
                    for param in path_item["parameters"]:
                        if "name" in param:
                            original_name = param["name"]
                            sanitized_name = sanitize_parameter_name(original_name)
                            if sanitized_name != original_name:
                                logger.debug(f"Sanitized path-level parameter: '{original_name}' -> '{sanitized_name}'")
                                param["name"] = sanitized_name
                                parameter_mapping[sanitized_name] = original_name
                
                # Sanitize operation-level parameters
                for method, operation in path_item.items():
                    if method.lower() not in ["get", "post", "put", "delete", "patch", "options", "head", "trace"]:
                        continue
                    if not isinstance(operation, dict):
                        continue
                        
                    if "parameters" in operation:
                        for param in operation["parameters"]:
                            if "name" in param:
                                original_name = param["name"]
                                sanitized_name = sanitize_parameter_name(original_name)
                                if sanitized_name != original_name:
                                    logger.debug(f"Sanitized operation parameter: '{original_name}' -> '{sanitized_name}'")
                                    param["name"] = sanitized_name
                                    parameter_mapping[sanitized_name] = original_name
        
        # Sanitize parameters in components (OpenAPI 3.0)
        if "components" in spec and "parameters" in spec["components"]:
            for param_name, param_def in spec["components"]["parameters"].items():
                if isinstance(param_def, dict) and "name" in param_def:
                    original_name = param_def["name"]
                    sanitized_name = sanitize_parameter_name(original_name)
                    if sanitized_name != original_name:
                        logger.debug(f"Sanitized component parameter: '{original_name}' -> '{sanitized_name}'")
                        param_def["name"] = sanitized_name
                        parameter_mapping[sanitized_name] = original_name
        
        return parameter_mapping
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description only states 'List alerts' without explaining what the tool actually does behaviorally—whether it returns all alerts, filtered alerts, paginated results, or requires authentication. The inclusion of query parameters and response examples in the description adds some context about pagination and output format, but this is minimal and doesn't cover critical aspects like permissions, rate limits, or error handling.

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 structured with sections for query parameters and responses, which is organized. However, it's overly verbose in some areas (e.g., repeating 'No description' for parameters) while being too brief in others (e.g., the core purpose is just two words). The response example adds length without clear utility. Overall, it's not efficiently front-loaded, but the structure attempts to convey information.

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

Completeness2/5

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

Given the complexity (3 parameters, no annotations, schema coverage 0%, but has an output schema), the description is incomplete. It mentions an output schema exists (with a 200 response example), which reduces the need to detail return values, but it fails to explain the tool's behavior, parameter usage, or differentiation from siblings. For a listing tool with pagination parameters, more context on how to use it effectively is missing.

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

Parameters2/5

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

The schema description coverage is 0%, meaning none of the 3 parameters have descriptions in the schema. The description lists the parameters ('include', 'page_number', 'page_size') but provides no semantic information about what they do, their expected values, or how they affect the listing. For example, it doesn't explain what 'include' might filter or what the pagination parameters control. This fails to compensate for the lack of schema documentation.

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

Purpose2/5

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

The description states 'List alerts' which is a tautology that merely restates the tool name. It doesn't specify what kind of alerts, from what system, or what scope. While 'list' is a clear verb and 'alerts' is the resource, this is too vague to be helpful. It doesn't distinguish from sibling tools like 'listIncidentAlerts' or 'listIncidents' which might handle similar data.

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

Usage Guidelines1/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. There are multiple sibling tools that might handle alerts or related data (e.g., 'listIncidentAlerts', 'attachAlert', 'createAlert'), but the description doesn't mention any of them or provide context about when this specific listing tool is appropriate versus others.

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/Rootly-AI-Labs/Rootly-MCP-server'

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