template_update
Modify existing Zabbix templates by updating technical name, visible name, or description. Accepts a template ID and returns JSON formatted update results.
Instructions
Update an existing template in Zabbix.
Args:
templateid: Template ID to update
host: New template technical name
name: New template visible name
description: New template description
Returns:
str: JSON formatted update result
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | ||
| host | No | ||
| name | No | ||
| templateid | Yes |
Implementation Reference
- src/zabbix_mcp_server.py:663-690 (handler)The complete implementation of the 'template_update' MCP tool. This handler function is registered via the @mcp.tool() decorator. It performs read-only validation, retrieves the Zabbix API client, constructs update parameters conditionally, calls the Zabbix template.update API method, and returns a formatted JSON response. The function signature and docstring define the input schema.@mcp.tool() def template_update(templateid: str, host: Optional[str] = None, name: Optional[str] = None, description: Optional[str] = None) -> str: """Update an existing template in Zabbix. Args: templateid: Template ID to update host: New template technical name name: New template visible name description: New template description Returns: str: JSON formatted update result """ validate_read_only() client = get_zabbix_client() params = {"templateid": templateid} if host: params["host"] = host if name: params["name"] = name if description: params["description"] = description result = client.template.update(**params) return format_response(result)