create_application_category
Group applications by namespace/name patterns to organize monitoring and configure incident/deployment notifications in Coroot.
Instructions
Create a new application category.
Creates a category for grouping applications based on namespace/name patterns. Patterns must be space-separated and in format namespace/name (e.g., "test/* demo/*"). Each pattern must contain exactly one '/' and cannot start with '/'.
Args: project_id: Project ID name: Category name (lowercase letters, numbers, hyphens, underscores; min 3 chars) custom_patterns: Space-separated glob patterns (e.g., "test/* demo/*") notify_incidents: Whether to notify about incidents (default: True) notify_deployments: Whether to notify about deployments (default: False) slack_channel: Slack channel for notifications (optional)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| name | Yes | ||
| custom_patterns | Yes | ||
| notify_incidents | No | ||
| notify_deployments | No | ||
| slack_channel | No |
Implementation Reference
- src/mcp_coroot/server.py:831-863 (handler)Primary MCP tool handler: the @mcp.tool()-decorated function that defines the tool interface, input parameters, and calls the implementation. This is the exact implementation executed when the tool is called.@mcp.tool() async def create_application_category( project_id: str, name: str, custom_patterns: str, notify_incidents: bool = True, notify_deployments: bool = False, slack_channel: str | None = None, ) -> dict[str, Any]: """Create a new application category. Creates a category for grouping applications based on namespace/name patterns. Patterns must be space-separated and in format namespace/name (e.g., "test/* demo/*"). Each pattern must contain exactly one '/' and cannot start with '/'. Args: project_id: Project ID name: Category name (lowercase letters, numbers, hyphens, underscores; min 3 chars) custom_patterns: Space-separated glob patterns (e.g., "test/* demo/*") notify_incidents: Whether to notify about incidents (default: True) notify_deployments: Whether to notify about deployments (default: False) slack_channel: Slack channel for notifications (optional) """ return await create_application_category_impl( # type: ignore[no-any-return] project_id, name, custom_patterns, notify_incidents, notify_deployments, slack_channel, )
- src/mcp_coroot/server.py:787-829 (helper)Supporting implementation function that constructs the category configuration dictionary (with patterns, notifications) and calls the CorootClient method.async def create_application_category_impl( project_id: str, name: str, custom_patterns: str, notify_incidents: bool = True, notify_deployments: bool = False, slack_channel: str | None = None, ) -> dict[str, Any]: """Create a new application category.""" category: dict[str, Any] = { "name": name, "builtin": False, "default": False, "builtin_patterns": "", "custom_patterns": custom_patterns, "notification_settings": { "incidents": { "enabled": notify_incidents, }, "deployments": { "enabled": notify_deployments, }, }, } # Add Slack channel if specified if slack_channel: notifications = category["notification_settings"] notifications["incidents"]["slack"] = { "enabled": True, "channel": slack_channel, } notifications["deployments"]["slack"] = { "enabled": notify_deployments, "channel": slack_channel, } await get_client().create_application_category(project_id, category) return { "success": True, "message": f"Application category '{name}' created successfully", }
- src/mcp_coroot/client.py:732-747 (helper)CorootClient HTTP client method that sends the POST request to Coroot API endpoint /api/project/{project_id}/application_categories to create the application category.async def create_application_category( self, project_id: str, category: dict[str, Any] ) -> dict[str, Any]: """Create a new application category. Args: project_id: Project ID. category: Category object with name and patterns. Returns: Created category. """ response = await self._request( "POST", f"/api/project/{project_id}/application_categories", json=category ) return self._parse_json_response(response)
- src/mcp_coroot/server.py:831-831 (registration)FastMCP tool registration decorator @mcp.tool() that registers the create_application_category function as an MCP tool.@mcp.tool()