Skip to main content
Glama

hostgroup_get

Retrieve Zabbix host groups using group IDs, search criteria, or filters. Returns a JSON-formatted list for integration with AI assistants or monitoring workflows.

Instructions

Get host groups from Zabbix.

Args: groupids: List of group IDs to retrieve output: Output format search: Search criteria filter: Filter criteria Returns: str: JSON formatted list of host groups

Input Schema

NameRequiredDescriptionDefault
filterNo
groupidsNo
outputNoextend
searchNo

Input Schema (JSON Schema)

{ "properties": { "filter": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Filter" }, "groupids": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Groupids" }, "output": { "default": "extend", "title": "Output", "type": "string" }, "search": { "anyOf": [ { "additionalProperties": { "type": "string" }, "type": "object" }, { "type": "null" } ], "default": null, "title": "Search" } }, "type": "object" }

Implementation Reference

  • The main handler function for the 'hostgroup_get' tool. It is registered via the @mcp.tool() decorator and implements the logic to fetch host groups from the Zabbix API based on provided parameters (groupids, output, search, filter), formats the params, calls client.hostgroup.get(**params), and returns JSON-formatted result using format_response.
    @mcp.tool() def hostgroup_get(groupids: Optional[List[str]] = None, output: Union[str, List[str]] = "extend", search: Optional[Dict[str, str]] = None, filter: Optional[Dict[str, Any]] = None) -> str: """Get host groups from Zabbix. Args: groupids: List of group IDs to retrieve output: Output format (extend or list of specific fields) search: Search criteria filter: Filter criteria Returns: str: JSON formatted list of host groups """ client = get_zabbix_client() params = {"output": output} if groupids: params["groupids"] = groupids if search: params["search"] = search if filter: params["filter"] = filter result = client.hostgroup.get(**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