item_create
Create new monitoring items in Zabbix by specifying name, key, host ID, type, value type, update interval, units, and description. Returns JSON formatted creation result.
Instructions
Create a new item in Zabbix.
Args:
name: Item name
key_: Item key
hostid: Host ID
type: Item type (0=Zabbix agent, 2=Zabbix trapper, etc.)
value_type: Value type (0=float, 1=character, 3=unsigned int, 4=text)
delay: Update interval
units: Value units
description: Item description
Returns:
str: JSON formatted creation result
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| delay | No | 1m | |
| description | No | ||
| hostid | Yes | ||
| key_ | Yes | ||
| name | Yes | ||
| type | Yes | ||
| units | No | ||
| value_type | Yes |
Implementation Reference
- src/zabbix_mcp_server.py:370-409 (handler)The handler function for the 'item_create' tool, registered via @mcp.tool() decorator. It validates read-only mode, gets the Zabbix API client, constructs parameters for item creation, calls client.item.create(), and returns formatted JSON response.@mcp.tool() def item_create(name: str, key_: str, hostid: str, type: int, value_type: int, delay: str = "1m", units: Optional[str] = None, description: Optional[str] = None) -> str: """Create a new item in Zabbix. Args: name: Item name key_: Item key hostid: Host ID type: Item type (0=Zabbix agent, 2=Zabbix trapper, etc.) value_type: Value type (0=float, 1=character, 3=unsigned int, 4=text) delay: Update interval units: Value units description: Item description Returns: str: JSON formatted creation result """ validate_read_only() client = get_zabbix_client() params = { "name": name, "key_": key_, "hostid": hostid, "type": type, "value_type": value_type, "delay": delay } if units: params["units"] = units if description: params["description"] = description result = client.item.create(**params) return format_response(result)