Skip to main content
Glama
Rootly-AI-Labs

Rootly MCP server

Official

listIncident_Types

List and filter incident types on the Rootly MCP server to retrieve detailed metadata, enabling efficient incident management through customizable query parameters.

Instructions

List incident types

Query Parameters:

  • include: No description.

  • page_number: No description.

  • page_size: No description.

  • filter_slug: No description.

  • filter_name: No description.

  • filter_color: No description.

  • filter_created_at_gt: No description.

  • filter_created_at_gte: No description.

  • filter_created_at_lt: No description.

  • filter_created_at_lte: No description.

  • sort: No description.

Responses:

  • 200 (Success): success

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

    • Example:

{
  "key": "value"
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filter_colorNo
filter_created_at_gtNo
filter_created_at_gteNo
filter_created_at_ltNo
filter_created_at_lteNo
filter_nameNo
filter_slugNo
includeNo
page_numberNo
page_sizeNo
sortNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registers all OpenAPI-derived MCP tools including 'listIncidentTypes' for the GET /v1/incident_types endpoint using FastMCP.from_openapi
    # By default, all routes become tools which is what we want
    mcp = FastMCP.from_openapi(
        openapi_spec=filtered_spec,
        client=http_client.client,
        name=name,
        timeout=30.0,
        tags={"rootly", "incident-management"},
    )
  • The AuthenticatedHTTPXClient.request method serves as the core handler logic for all generated OpenAPI tools, including listIncidentTypes, proxying requests to the Rootly API after parameter transformation
    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 OpenAPI parameter names (e.g., page[size] to page_size) to MCP-compliant format and creates mapping for reverse transformation; called for all tools including listIncidentTypes
    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
  • Includes "/incident_types" in DEFAULT_ALLOWED_PATHS, enabling the listIncidentTypes tool by filtering the OpenAPI spec to retain this endpoint
    # Incident types
    "/incident_types",
  • Applies parameter sanitization to the filtered OpenAPI spec, defining input schemas with MCP-compliant parameter names for tools like listIncidentTypes
    parameter_mapping = sanitize_parameters_in_spec(filtered_spec)

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