update_application_risks
Configure risk thresholds and monitoring parameters to identify potential issues before they impact users in Coroot applications.
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 |
|---|---|---|---|
| project_id | Yes | ||
| app_id | Yes | ||
| risks | Yes |
Implementation Reference
- src/mcp_coroot/server.py:1129-1148 (handler)MCP tool handler function that is registered via @mcp.tool() decorator and implements the core logic by calling the client implementation.@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-929 (helper)CorootClient method that performs the actual HTTP POST request to the Coroot API endpoint to update 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)Wrapper function decorated with error handler that calls the client method and formats the response.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, }
- src/mcp_coroot/server.py:1129-1129 (registration)FastMCP tool registration decorator applied to the handler function.@mcp.tool()