Skip to main content
Glama

Run a raw Indexer query

wazuh_indexer_query
Read-onlyIdempotent

Execute raw OpenSearch query DSL on Wazuh indices for custom aggregations, scripted fields, and composite queries that standard alert tools cannot express. Limited to read-only searches on wazuh-* indices.

Instructions

Escape hatch: send a raw OpenSearch query DSL body to a Wazuh index for anything the purpose-built alert tools cannot express — unusual aggregations, scripted fields, composite queries. Restricted to wazuh-* indices and read-only _search.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesOpenSearch query DSL body, e.g. {"query": {"match_all": {}}, "size": 5, "aggs": {...}}. Always set an explicit small 'size' unless you only need aggregations.
indexNoIndex pattern to search. Defaults to the configured alerts index. Must start with a wazuh-* prefix.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

The description reinforces the read-only nature by stating 'read-only _search' and 'Restricted to wazuh-* indices', which aligns with the annotations (readOnlyHint true, destructiveHint false). It adds the restriction context beyond the annotations, making behavior fully transparent.

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?

The description is concise and well-structured: it opens with the core purpose ('Escape hatch'), then explains the scope and restrictions in two clear sentences. No unnecessary details or repetitions.

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

Completeness5/5

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

The description covers the tool's purpose, usage context, constraints, and parameter behavior. Since an output schema exists, return value details are not needed, and the description is complete for an agent to select and invoke this tool correctly.

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

Parameters5/5

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

Both parameters are thoroughly described. The body parameter includes an example and a best-practice note about setting a small 'size' unless aggregations are needed, while the index parameter explains the default and the required wazuh-* prefix. This goes well beyond the schema descriptions.

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?

The description clearly states the tool sends a raw OpenSearch query DSL body to a Wazuh index, with a specific verb and resource. It also distinguishes itself from purpose-built alert tools by explicitly stating it handles anything they cannot express, such as unusual aggregations, scripted fields, and composite queries.

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

Usage Guidelines5/5

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

The description explicitly positions the tool as an 'escape hatch' for cases where purpose-built alert tools are insufficient, and provides concrete restrictions (wazuh-* indices and read-only _search). This gives clear when-to-use guidance compared to sibling tools like wazuh_search_alerts or wazuh_alert_stats.

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