template_create
Generate and configure new Zabbix monitoring templates by specifying technical names, host groups, visible names, and descriptions. Streamlines template creation for efficient system monitoring.
Instructions
Create a new template in Zabbix.
Args:
host: Template technical name
groups: List of host groups (format: [{"groupid": "1"}])
name: Template visible name
description: Template description
Returns:
str: JSON formatted creation result
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | ||
| groups | Yes | ||
| host | Yes | ||
| name | No |
Input Schema (JSON Schema)
{
"properties": {
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Description"
},
"groups": {
"items": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"title": "Groups",
"type": "array"
},
"host": {
"title": "Host",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
}
},
"required": [
"host",
"groups"
],
"type": "object"
}
Implementation Reference
- src/zabbix_mcp_server.py:632-661 (handler)Implements the template_create MCP tool handler. Creates a new Zabbix template using the ZabbixAPI client.template.create method. Validates read-only mode first and formats the response as JSON.@mcp.tool() def template_create(host: str, groups: List[Dict[str, str]], name: Optional[str] = None, description: Optional[str] = None) -> str: """Create a new template in Zabbix. Args: host: Template technical name groups: List of host groups (format: [{"groupid": "1"}]) name: Template visible name description: Template description Returns: str: JSON formatted creation result """ validate_read_only() client = get_zabbix_client() params = { "host": host, "groups": groups } if name: params["name"] = name if description: params["description"] = description result = client.template.create(**params) return format_response(result)