Skip to main content
Glama
mpeirone

zabbix-mcp-server

discoveryrule_get

Retrieve discovery rules from Zabbix with customizable filters for item IDs, host IDs, and template IDs. Returns JSON-formatted data for precise monitoring and integration.

Instructions

Get discovery rules from Zabbix with optional filtering.

Args:
    itemids: List of discovery rule IDs to retrieve
    hostids: List of host IDs to filter by
    templateids: List of template IDs to filter by
    output: Output format
    search: Search criteria
    filter: Filter criteria
    
Returns:
    str: JSON formatted list of discovery rules

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNo
hostidsNo
itemidsNo
outputNoextend
searchNo
templateidsNo

Implementation Reference

  • The discoveryrule_get MCP tool handler function, registered via @mcp.tool() decorator. Retrieves discovery rules using Zabbix API with filtering parameters and returns JSON-formatted response.
    def discoveryrule_get(itemids: Optional[List[str]] = None,
                          hostids: Optional[List[str]] = None,
                          templateids: Optional[List[str]] = None,
                          output: Union[str, List[str]] = "extend",
                          search: Optional[Dict[str, str]] = None,
                          filter: Optional[Dict[str, Any]] = None) -> str:
        """Get discovery rules from Zabbix with optional filtering.
        
        Args:
            itemids: List of discovery rule IDs to retrieve
            hostids: List of host IDs to filter by
            templateids: List of template IDs to filter by
            output: Output format (extend or list of specific fields)
            search: Search criteria
            filter: Filter criteria
            
        Returns:
            str: JSON formatted list of discovery rules
        """
        client = get_zabbix_client()
        params = {"output": output}
        
        if itemids:
            params["itemids"] = itemids
        if hostids:
            params["hostids"] = hostids
        if templateids:
            params["templateids"] = templateids
        if search:
            params["search"] = search
        if filter:
            params["filter"] = filter
        
        result = client.discoveryrule.get(**params)
        return format_response(result)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves data ('Get'), implying it's a read operation, but doesn't clarify permissions, rate limits, pagination, or error handling. The return format is mentioned ('JSON formatted list'), but without an output schema, details like structure or examples are missing, leaving behavioral traits under-specified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and appropriately sized: a clear purpose statement followed by parameter and return sections. Every sentence adds value, with no redundancy or fluff. It could be slightly more front-loaded by integrating parameter hints into the purpose, but overall it's efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (6 parameters, no annotations, no output schema), the description is moderately complete. It covers the basic purpose and parameters but lacks behavioral details, usage context, and output specifics. For a read operation with filtering options, this is adequate but leaves gaps that could hinder effective tool selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description lists all six parameters with brief labels, but schema description coverage is 0%, so the schema provides no additional details. The description adds minimal semantics (e.g., 'List of discovery rule IDs to retrieve' for 'itemids'), which is better than nothing but lacks depth on usage, formats, or interactions. This meets the baseline for some compensation but doesn't fully address the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get discovery rules from Zabbix with optional filtering.' It specifies the verb ('Get'), resource ('discovery rules'), and system ('Zabbix'), making the function unambiguous. However, it doesn't differentiate from sibling tools like 'item_get' or 'trigger_get' beyond the resource type, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions 'optional filtering' but doesn't specify scenarios where filtering is beneficial or when other tools might be more appropriate. With many sibling tools available (e.g., 'host_get', 'item_get'), the lack of comparative context is a significant gap.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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