hostgroup_create
Create a new host group in Zabbix by specifying the group name, enabling organized monitoring and management of devices within the Zabbix-MCP server.
Instructions
Create a new host group in Zabbix.
Args:
name: Host group name
Returns:
str: JSON formatted creation result
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Input Schema (JSON Schema)
{
"properties": {
"name": {
"title": "Name",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
Implementation Reference
- src/zabbix_mcp_server.py:271-286 (handler)The 'hostgroup_create' tool handler function. Decorated with @mcp.tool() for registration in FastMCP. Validates read-only mode, authenticates Zabbix client if needed, calls the Zabbix API hostgroup.create method with the provided name, and returns formatted JSON response.@mcp.tool() def hostgroup_create(name: str) -> str: """Create a new host group in Zabbix. Args: name: Host group name Returns: str: JSON formatted creation result """ validate_read_only() client = get_zabbix_client() result = client.hostgroup.create(name=name) return format_response(result)