update_project_settings
Modify project settings such as retention and alerting configurations directly within the Coroot observability platform using the MCP Server.
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)MCP tool handler for 'update_project_settings'. This is the main entrypoint registered with FastMCP via @mcp.tool(). It delegates to the implementation function and handles the tool schema via signature and docstring.@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-1473 (handler)Implementation logic for the update_project_settings tool. Calls CorootClient.update_project and formats the success response. Decorated with @handle_errors for error handling.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)CorootClient.update_project method: Makes HTTP POST to /api/project/{project_id} with settings. Validates project name pattern. This is the core API integration.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