update_application_risks
Update and configure risk thresholds for applications to proactively identify potential issues. Adjust monitoring parameters to enhance observability and ensure optimal performance.
Instructions
Update risk assessment configuration for an application.
Configures risk thresholds and monitoring parameters to better identify potential issues before they impact users.
Args: project_id: Project ID app_id: Application ID (format: namespace/kind/name) risks: Risk assessment configuration
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | Yes | ||
| project_id | Yes | ||
| risks | Yes |
Implementation Reference
- src/mcp_coroot/server.py:1129-1148 (handler)The main MCP tool handler for 'update_application_risks'. This is the entry point decorated with @mcp.tool() that defines the tool schema via types and docstring, and delegates to the implementation function.@mcp.tool() async def update_application_risks( project_id: str, app_id: str, risks: dict[str, Any], ) -> dict[str, Any]: """Update risk assessment configuration for an application. Configures risk thresholds and monitoring parameters to better identify potential issues before they impact users. Args: project_id: Project ID app_id: Application ID (format: namespace/kind/name) risks: Risk assessment configuration """ return await update_application_risks_impl( # type: ignore[no-any-return] project_id, app_id, risks )
- src/mcp_coroot/client.py:890-928 (helper)CorootClient helper method that performs the HTTP POST request to the Coroot API endpoint /api/project/{project_id}/app/{app_id}/risks to update the application risks.async def update_application_risks( self, project_id: str, app_id: str, risks: dict[str, Any] ) -> dict[str, Any]: """Update application risk assessment. Args: project_id: Project ID. app_id: Application ID (format: namespace/kind/name). risks: Risk assessment updates. Returns: Updated risk configuration. """ # URL encode the app_id since it contains slashes from urllib.parse import quote encoded_app_id = quote(app_id, safe="") response = await self._request( "POST", f"/api/project/{project_id}/app/{encoded_app_id}/risks", json=risks, ) # Handle different response types try: if response.headers.get("content-type", "").startswith("application/json"): data: dict[str, Any] = response.json() return data else: # If not JSON, return success with the provided risks return { "app_id": app_id, "risks": risks, "status": "updated", } except Exception: # If parsing fails, return minimal success response return {"app_id": app_id, "status": "updated"}
- src/mcp_coroot/server.py:1115-1127 (helper)Internal helper implementation in the MCP server that calls the CorootClient method and formats the response with success/error handling.async def update_application_risks_impl( project_id: str, app_id: str, risks: dict[str, Any], ) -> dict[str, Any]: """Update application risk assessment.""" result = await get_client().update_application_risks(project_id, app_id, risks) return { "success": True, "message": "Application risks updated successfully", "risks": result, }