--- name: wazuh-mcp-querying description: How to query Wazuh through the Wazuh MCP Server efficiently and correctly — which tool answers which question, parameter syntax and pitfalls, result format, truncation, token budget and error handling; load before your first Wazuh query in a run. allowed-tools: get_case search_cases list_actions add_finding metadata: category: command display_name: Wazuh MCP Querying standards: [nist-csf-2, owasp-llm-top10] version: "1.0" --- # Wazuh MCP Querying Every agent reads Wazuh only through the Wazuh MCP Server (gensecaihq/Wazuh-MCP-Server v4.3.0). You hold a subset of its tools — the ones in your tool list. This skill is reference knowledge: use the tools **you hold**; for anything else, hand off to the agent that owns it. ## Which tool answers which question | Question | Tool | Notes | |---|---|---| | Show me the alerts matching X | `get_wazuh_alerts` | Filters: `rule_id`, `level`, `agent_id`, `rule_groups`, `timestamp_start/_end`, `limit`, `compact` | | Free-text / IP-centric search | `search_security_events` | `query`, `srcip`, `dstip`, `rule_id`, `agent_id`, `level`, `time_range` (enum) | | What is noisy / what dominates? | `get_alerts_aggregated` | Top rules and top agents for a window — start here, then drill down | | Recurring patterns | `analyze_alert_patterns` | `time_range` enum, `min_frequency` | | Volume by level / rule / group / agent | `get_wazuh_alert_summary` | `group_by`: `rule.level`, `rule.id`, `rule.groups`, `agent.id`, `agent.name` | | Which agents exist / their status | `get_wazuh_agents` | `status`: active, disconnected, never_connected, pending | | Is this agent healthy? | `check_agent_health` | Connection state, last keepalive, version | | What runs / listens on a host | `get_agent_processes`, `get_agent_ports` | Syscollector inventory (periodic, not live) | | Agent config (FIM paths, log sources) | `get_agent_configuration` | Confirms what is actually monitored | | Vulnerabilities | `get_wazuh_vulnerabilities`, `get_wazuh_critical_vulnerabilities`, `get_wazuh_vulnerability_summary` | `severity` enum, `limit` max 500 | | Hardening state | `get_sca_policy_checks` | Per agent and SCA policy | | Compliance posture | `run_compliance_check`, ISO 27001 tools | `framework` enum | | Platform health | `get_wazuh_statistics`, `get_wazuh_cluster_health`, `get_wazuh_remoted_stats`, `get_wazuh_log_collector_stats`, manager log tools | Owned by platform-engineer | | Current endpoint state after an action | `wazuh_check_*` | Read-only verification tools | `get_wazuh_log_collector_stats` returns **analysisd** statistics (decoding / rule-matching throughput), not per-agent logcollector counters — read it that way. ## Parameter syntax and pitfalls - **Level**: a string. `"10"` means level 10 only in some filters; use `"10+"` for "10 and above". Invalid formats come back as an error, not an empty result. - **Time**: `timestamp_start` / `timestamp_end` accept ISO 8601 (`2026-09-23T10:00:00Z`) or relative date math (`now-24h`, `now-7d`, `now-15m`). `search_security_events` and the summary/pattern tools take an enum `time_range` (`1h`, `6h`, `12h`, `1d`, `24h`, `7d`, `30d`) instead. - **Limits**: alert and event limits default to 100 and cap at 1000; vulnerabilities cap at 500. - **compact** (default `true`) returns essential fields only. Keep it on unless you need `full_log`, `data.win.*` or `syscheck.*` details for a specific alert — then fetch that alert narrowly. - **rule_groups** is a list with **OR** semantics: `["authentication_failed", "sshd"]` returns alerts in either group, not both. - **agent_id** is a zero-padded 3+ digit string: `"001"`, not `1`. `"000"` is the Wazuh manager itself — the MCP server refuses host-level active response against it. - Unknown arguments are rejected. Use the exact parameter names from the tool schema. ## Result format Results arrive as one text block: `"