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+jsonExample:
{
"key": "value"
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter_color | No | ||
| filter_created_at_gt | No | ||
| filter_created_at_gte | No | ||
| filter_created_at_lt | No | ||
| filter_created_at_lte | No | ||
| filter_name | No | ||
| filter_slug | No | ||
| include | No | ||
| page_number | No | ||
| page_size | No | ||
| sort | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/rootly_mcp_server/server.py:337-344 (registration)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"}, ) - src/rootly_mcp_server/server.py:227-234 (handler)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)