update_application_category
Modify application category settings in the Coroot observability platform. Update notification preferences, custom patterns, or Slack channel for incidents and deployments based on project ID and category name.
Instructions
Update an existing application category.
Updates specific fields of an application category. Only provided fields are updated.
Args: project_id: Project ID name: Category name to update custom_patterns: New space-separated glob patterns (optional) notify_incidents: Whether to notify about incidents (optional) notify_deployments: Whether to notify about deployments (optional) slack_channel: Slack channel for notifications (optional)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| custom_patterns | No | ||
| name | Yes | ||
| notify_deployments | No | ||
| notify_incidents | No | ||
| project_id | Yes | ||
| slack_channel | No |
Implementation Reference
- src/mcp_coroot/server.py:866-913 (handler)Main handler logic for the MCP tool: fetches current category config, selectively applies updates to patterns/notifications/Slack, then calls client to persist changes.@handle_errors async def update_application_category_impl( project_id: str, name: str, custom_patterns: str | None = None, notify_incidents: bool | None = None, notify_deployments: bool | None = None, slack_channel: str | None = None, ) -> dict[str, Any]: """Update an existing application category.""" # First get the existing category categories = await get_client().get_application_categories(project_id) existing: dict[str, Any] | None = None for cat in categories: if isinstance(cat, dict) and cat.get("name") == name: existing = cat break if not existing: raise ValueError(f"Category '{name}' not found") # Update only specified fields if custom_patterns is not None: existing["custom_patterns"] = custom_patterns if notify_incidents is not None: existing["notification_settings"]["incidents"]["enabled"] = notify_incidents if notify_deployments is not None: existing["notification_settings"]["deployments"]["enabled"] = notify_deployments if slack_channel is not None: if "slack" not in existing["notification_settings"]["incidents"]: existing["notification_settings"]["incidents"]["slack"] = {} slack = existing["notification_settings"]["incidents"]["slack"] slack["channel"] = slack_channel slack["enabled"] = True if "slack" not in existing["notification_settings"]["deployments"]: existing["notification_settings"]["deployments"]["slack"] = {} slack = existing["notification_settings"]["deployments"]["slack"] slack["channel"] = slack_channel await get_client().update_application_category(project_id, name, existing) return { "success": True, "message": f"Application category '{name}' updated successfully", }
- src/mcp_coroot/server.py:916-946 (registration)MCP tool registration via @mcp.tool() decorator. Defines input schema via args and docstring, delegates to impl handler.@mcp.tool() async def update_application_category( project_id: str, name: str, custom_patterns: str | None = None, notify_incidents: bool | None = None, notify_deployments: bool | None = None, slack_channel: str | None = None, ) -> dict[str, Any]: """Update an existing application category. Updates specific fields of an application category. Only provided fields are updated. Args: project_id: Project ID name: Category name to update custom_patterns: New space-separated glob patterns (optional) notify_incidents: Whether to notify about incidents (optional) notify_deployments: Whether to notify about deployments (optional) slack_channel: Slack channel for notifications (optional) """ return await update_application_category_impl( # type: ignore[no-any-return] project_id, name, custom_patterns, notify_incidents, notify_deployments, slack_channel, )
- src/mcp_coroot/server.py:925-937 (schema)Input schema and documentation defined in the tool function's docstring, specifying parameters and their purposes."""Update an existing application category. Updates specific fields of an application category. Only provided fields are updated. Args: project_id: Project ID name: Category name to update custom_patterns: New space-separated glob patterns (optional) notify_incidents: Whether to notify about incidents (optional) notify_deployments: Whether to notify about deployments (optional) slack_channel: Slack channel for notifications (optional) """
- src/mcp_coroot/client.py:749-767 (helper)CorootClient helper method that sets 'id' field and makes POST request to Coroot API /application_categories endpoint to perform the update.async def update_application_category( self, project_id: str, category_name: str, category: dict[str, Any] ) -> dict[str, Any]: """Update an existing application category. Args: project_id: Project ID. category_name: Name of the category to update. category: Updated category object. Returns: Updated category. """ # Set the id field for updates category["id"] = category_name response = await self._request( "POST", f"/api/project/{project_id}/application_categories", json=category ) return self._parse_json_response(response)