update_ai_config
Configure AI provider settings on the MCP Server for Coroot to enhance root cause analysis by updating API keys, model selection, and related parameters.
Instructions
Update AI provider configuration.
Configures AI provider settings for enhanced root cause analysis.
Args: config: AI provider settings (API keys, model selection, etc.)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| config | Yes |
Implementation Reference
- src/mcp_coroot/client.py:1473-1484 (handler)Core handler function that executes the tool logic by sending a POST request to the Coroot API endpoint /api/ai with the provided configuration.async def update_ai_config(self, config: dict[str, Any]) -> dict[str, Any]: """Update AI provider configuration. Args: config: AI provider settings. Returns: Updated AI configuration. """ response = await self._request("POST", "/api/ai", json=config) data: dict[str, Any] = response.json() return data
- src/mcp_coroot/server.py:1866-1875 (registration)MCP tool registration using @mcp.tool() decorator, defining the tool name, docstring, and input schema via type hints.@mcp.tool() async def update_ai_config(config: dict[str, Any]) -> dict[str, Any]: """Update AI provider configuration. Configures AI provider settings for enhanced root cause analysis. Args: config: AI provider settings (API keys, model selection, etc.) """ return await update_ai_config_impl(config) # type: ignore[no-any-return]
- src/mcp_coroot/server.py:1854-1864 (helper)Helper implementation that wraps the client call with standardized success/error response format and error handling.@handle_errors async def update_ai_config_impl(config: dict[str, Any]) -> dict[str, Any]: """Update AI configuration.""" client = get_client() result = await client.update_ai_config(config) return { "success": True, "message": "AI configuration updated successfully", "config": result, }