Skip to main content
Glama
Zabbix MCP Server

Zabbix MCP Server

by mhajder

Usermacro Create

usermacro_create

Create a host macro in Zabbix to define host-specific variables for use in items and triggers via {$MACRO_NAME}, enabling configuration changes without editing each item.

Instructions

Create a new host macro in Zabbix.

Host macros define custom variables for specific hosts. They can be referenced in items and triggers using {$MACRO_NAME} syntax, allowing dynamic configuration without editing items.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "hostid": "<hostid>",
      "macro": "<macro>",
      "value": "<value>"
    },
    "name": "usermacro_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
macroYesMacro name (e.g., {$MYMACRO}).
type_No0=text, 1=secret, 2=vault.
valueYesMacro value.
hostidYesHost ID for the macro.
descriptionNoOptional description explaining the macro's purpose.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.3

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare this is a non-read-only, non-idempotent, non-destructive write, so the safety profile is covered. The description adds useful conceptual context (macros are referenced via {$MACRO_NAME} in items/triggers), but omits what happens on duplicate macro names, secret/vault value handling, or permission requirements implied by type_=1/2.

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 action is front-loaded in the first sentence, followed by a short explanatory paragraph about macro reference syntax. Nothing is padded, though the second paragraph is context rather than invocation guidance.

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

Completeness4/5

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

An output schema exists, so return values need not be described, and the schema fully documents parameters. Remaining gaps are duplicate-name behavior and error modes for a non-idempotent create, which would be nice but are not essential to invoke correctly.

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?

Schema description coverage is 100%, so all five parameters, including the type_ enum meaning and macro format, are documented in the schema. The description reinforces the {$MACRO_NAME} convention but adds no semantics beyond what the schema already provides.

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?

States a specific verb and resource ("Create a new host macro in Zabbix") and clarifies the host-level scope, which distinguishes it from generic macro handling. It does not explicitly contrast with sibling usermacro_get/usermacro_delete, but the create intent is unambiguous.

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?

There is no statement of when to use this versus usermacro_get, usermacro_delete, host_create, or template/global-level macros. The only implied guidance is the word "host" scoping the macro level; no prerequisites, exclusions, or alternative-routing advice is given.

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