Skip to main content
Glama
Zabbix MCP Server

Zabbix MCP Server

script_getscriptsbyhosts

Read-only

Get scripts available for specified hosts, mapped by host ID and filtered by permissions and scope. Use it to build dynamic script menus in host detail views.

Instructions

Get scripts available for the given hosts. Returns a mapping of host IDs to the scripts that can be executed on each host. Takes into account host group permissions and script scope. Useful for building dynamic script menus in host detail views.

Input Schema

NameRequiredDescriptionDefault
serverNoTarget Zabbix server. Available: default. Defaults to 'default' if omitted.
hostidsYesHost IDs to get available scripts for.
raw_jsonNoStrips the security disclaimer preamble from the response so it is pure JSON. Default: false. Requires the bearer token to have 'allow_raw_json' explicitly enabled by an operator in the admin portal - tokens without that policy receive a PolicyError instead. WARNING: setting true bypasses the prompt-injection mitigation marker that wraps untrusted Zabbix data (host names, item descriptions, problem text). LLM clients (Claude, GPT, Cursor, ...) should leave this false; only programmatic non-LLM consumers (Python scripts, n8n workflows that json.loads the result) should set true.
scriptidNoReturn only this script, with its macros resolved for each host. Zabbix 7.0+.
manualinputNoValue of the {MANUALINPUT} macro to resolve in the script. Zabbix 7.0+.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.42.2
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / manualinput
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Value of the {MANUALINPUT} macro to resolve in the script. Zabbix 7.0+.",
      +  "title": "Manualinput"
      +}
    • addedInput schema / properties / scriptid
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Return only this script, with its macros resolved for each host. Zabbix 7.0+.",
      +  "title": "Scriptid"
      +}
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "title": "Result",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "script_getscriptsbyhostsOutput",
      -  "type": "object"
      -}New value: +null
  2. First observedv1.41.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered. The description adds real behavioral context beyond that: results are permission-filtered by host group and constrained by script scope, which explains why a caller may see fewer scripts than exist. It does not restate the schema's raw_json policy warning, but that belongs to the parameter, not the tool behavior.

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

Conciseness5/5

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

Four short sentences, each doing distinct work: action, return shape, filtering behavior, use case. The return shape is stated immediately after the action, so the most decision-relevant facts are front-loaded with no filler.

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?

With no output schema, the description correctly carries the burden of explaining the return value as a host-ID-to-scripts mapping, and it explains permission filtering. What's missing is how the response changes when scriptid is supplied (single script with macros resolved per host), which the schema documents but the description never reconciles with its mapping claim.

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 every parameter including scriptid, manualinput, and raw_json is already documented in structured data. The description adds no parameter-level meaning (e.g., whether scriptid changes the return shape from a mapping to a flat list), so the baseline 3 applies.

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

Purpose5/5

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

States a specific verb and resource with explicit scope: scripts available for the given hosts, filtered by host group permissions and script scope. This separates it from script_get (all scripts) and script_getscriptsbyevents (scripts for events) without the agent needing to open either schema.

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

Usage Guidelines4/5

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

"Useful for building dynamic script menus in host detail views" gives a concrete use context that tells the agent when to reach for this tool. It stops short of naming alternatives or stating when-not-to-use it, so it falls just short of a 5.

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