update_inspection_config
Modify inspection settings for applications in Coroot to customize monitoring of CPU, memory, SLO, and other performance metrics.
Instructions
Update inspection configuration for an application.
Updates the configuration for a specific inspection type. Configuration format depends on the inspection type.
Args: project_id: Project ID app_id: Application ID (format: namespace/kind/name) inspection_type: Type of inspection (cpu, memory, slo, etc) config: New configuration (format varies by type)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| app_id | Yes | ||
| inspection_type | Yes | ||
| config | Yes |
Implementation Reference
- src/mcp_coroot/server.py:740-760 (handler)MCP tool handler function decorated with @mcp.tool(), which handles input parameters, calls the implementation wrapper, and returns standardized response.@mcp.tool() async def update_inspection_config( project_id: str, app_id: str, inspection_type: str, config: dict[str, Any], ) -> dict[str, Any]: """Update inspection configuration for an application. Updates the configuration for a specific inspection type. Configuration format depends on the inspection type. Args: project_id: Project ID app_id: Application ID (format: namespace/kind/name) inspection_type: Type of inspection (cpu, memory, slo, etc) config: New configuration (format varies by type) """ return await update_inspection_config_impl( # type: ignore[no-any-return] project_id, app_id, inspection_type, config )
- src/mcp_coroot/server.py:722-738 (handler)Implementation wrapper that calls the CorootClient method and formats the success response with error handling decorator.@handle_errors async def update_inspection_config_impl( project_id: str, app_id: str, inspection_type: str, config: dict[str, Any], ) -> dict[str, Any]: """Update inspection configuration.""" result = await get_client().update_inspection_config( project_id, app_id, inspection_type, config ) return { "success": True, "message": f"{inspection_type} inspection configured successfully", "config": result, }
- src/mcp_coroot/client.py:691-715 (helper)Core API client method that performs the HTTP POST request to Coroot API to update the inspection configuration.async def update_inspection_config( self, project_id: str, app_id: str, inspection_type: str, config: dict[str, Any] ) -> dict[str, Any]: """Update inspection configuration for an application. Args: project_id: Project ID. app_id: Application ID. inspection_type: Type of inspection (cpu, memory, slo, etc). config: New configuration. Returns: Updated 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}/inspection/{inspection_type}/config", json=config, ) return self._parse_json_response(response)