Skip to main content
Glama
mpeirone

zabbix-mcp-server

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
NameRequiredDescriptionDefault
delayNo1m
descriptionNo
hostidYes
key_Yes
nameYes
typeYes
unitsNo
value_typeYes

Implementation Reference

  • 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)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mpeirone/zabbix-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server