update_project_settings
Modify project-level settings like retention policies and alerting configurations in the Coroot observability platform to customize monitoring behavior.
Instructions
Update project settings and configuration.
Updates project-level settings such as retention, alerting, etc.
Args: project_id: Project ID settings: Updated project settings
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| settings | Yes |
Implementation Reference
- src/mcp_coroot/server.py:1476-1488 (handler)Primary handler and registration for the 'update_project_settings' tool using @mcp.tool() decorator. This is the entry point executed when the tool is called.@mcp.tool() async def update_project_settings( project_id: str, settings: dict[str, Any] ) -> dict[str, Any]: """Update project settings and configuration. Updates project-level settings such as retention, alerting, etc. Args: project_id: Project ID settings: Updated project settings """ return await update_project_settings_impl(project_id, settings) # type: ignore[no-any-return]
- src/mcp_coroot/server.py:1464-1474 (helper)Helper implementation that wraps the CorootClient call and formats the response with success/error handling via @handle_errors decorator.async def update_project_settings_impl( project_id: str, settings: dict[str, Any] ) -> dict[str, Any]: """Update project settings.""" result = await get_client().update_project(project_id, settings) return { "success": True, "message": "Project settings updated successfully", "project": result, }
- src/mcp_coroot/client.py:1097-1127 (helper)Core API client method that performs the HTTP POST request to Coroot's /api/project/{project_id} endpoint to update project settings, including name validation.async def update_project( self, project_id: str, settings: dict[str, Any] ) -> dict[str, Any]: """Update project settings. Args: project_id: Project ID. settings: Updated project settings. Only 'name' field is supported. Name must match pattern: ^[-_0-9a-z]{3,}$ Returns: Updated project. """ # Validate project name if provided if "name" in settings: import re if not re.match(r"^[-_0-9a-z]{3,}$", settings["name"]): raise ValueError( "Project name must contain only lowercase letters, " "numbers, hyphens, and underscores (min 3 chars)" ) response = await self._request( "POST", f"/api/project/{project_id}", json=settings, ) data: dict[str, Any] = response.json() return data
- src/mcp_coroot/server.py:92-112 (helper)Utility function that lazily initializes and returns the shared CorootClient instance used by all tools.def get_client() -> CorootClient: """Get or create the client instance. Raises: ValueError: If no credentials are configured. """ global _client if _client is None: try: _client = CorootClient() except ValueError as e: # Re-raise with more context raise ValueError( "Coroot credentials not configured. " "Please set COROOT_BASE_URL and either:\n" " - COROOT_USERNAME and COROOT_PASSWORD for automatic login\n" " - COROOT_SESSION_COOKIE for direct authentication\n" " - COROOT_API_KEY for data ingestion endpoints" ) from e return _client