Skip to main content
Glama

search

Execute OpenSearch query DSL requests on Wazuh 5 datastreams to fetch security events and findings, receiving raw JSON responses with diagnostics when results are incomplete or need interpretation.

Instructions

Run an OpenSearch query DSL request against a Wazuh 5 index pattern.

Returns the raw JSON response, including aggregations, preceded by a diagnostics block when the result needs interpretation (zero hits, a truncated total, or an aggregation that covers only part of the result set).

Common patterns:

  • wazuh-events-v5-* all events

  • wazuh-findings-v5-* all detection findings

  • wazuh-events-v5-* one of: access-management, applications, cloud-services, network-activity, other, security, system-activity, unclassified

These are datastreams. Always query the wildcard pattern, never a backing index such as .ds-wazuh-events-v5-network-activity-000001.

The time field is @timestamp. There is no timestamp field in Wazuh 5. Set "track_total_hits": true whenever you need an exact count; without it OpenSearch stops counting at 10000.

A "size" larger than KLAXON_SEARCH_MAX_SIZE (default 100) is lowered to that limit before the query is sent, and the diagnostics block says so. Use "size": 0 with aggregations to count without pulling documents.

The same cap applies to the size of bucketed aggregations (terms, significant_terms, significant_text, multi_terms, composite, top_hits): an oversized aggregation size is lowered to KLAXON_SEARCH_MAX_SIZE before the query is sent and an "[AGG SIZE CAPPED]" diagnostics line names the affected aggregation and its requested size, so a lowered bucket count is never read as the real one.

When anonymization is enabled and KLAXON_ANONYMIZATION_MASK_AGGREGATION_KEYS is on, aggregation bucket keys for masked fields (terms, multi_terms, composite) are replaced with the same deterministic tokens as the _source pass — so aggregation keys and hits stay aligned for the same entity.

Args: index: Index or datastream pattern, e.g. "wazuh-events-v5-network-activity*". body: OpenSearch query DSL as a JSON string.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYes
indexYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided (readOnlyHint, destructiveHint absent), the description carries the full burden. It discloses: returns raw JSON with a diagnostics block when needed, caps size at KLAXON_SEARCH_MAX_SIZE, caps aggregation sizes, and anonymizes bucket keys when enabled. It even mentions the '[AGG SIZE CAPPED]' diagnostics line. This is extensive behavioral disclosure covering data transformation, limits, and conditional output.

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 long but each paragraph earns its place: the first gives the core purpose and diagnostics, the second lists common patterns, the third covers constraints (time field, track_total_hits, size cap), the fourth covers aggregation sizing, and the fifth covers anonymization. It front-loads the core purpose and the diagnostics. A minor deduction because the lsit of patterns and the anonymization paragraph could be trimmed or merged, but it's well-structured and not redundant.

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?

Given there's an output schema, the return format is already defined. The tool is complex (2 parameters, high behavioral complexity with caps, anonymization, diagnostics), and the description covers: index patterns and constraints, time field naming, track_total_hits semantics, size caps for both hits and aggregations, anonymization behavior, and the diagnostics block. There's nothing an agent needs to correctly call this tool that is missing. The description is complete for its complexity.

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 coverage is 0% (no descriptions in the input schema) and there are only two params: index and body. The description explains index thoroughly (patterns, wildcard requirement, datastream naming) and body as 'OpenSearch query DSL as a JSON string'. It doesn't elaborate on the body's structure beyond that, but body is generic DSL where the user must provide the JSON. The description adds meaning for index beyond the schema (which only says 'string') and a reasonable definition of body.

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 verb ('Run an OpenSearch query DSL request') and the resource ('Wazuh 5 index pattern'). It strongly distinguishes itself from siblings—while 'schema' likely describes the index schema and 'findings_overview' summarizes findings, this tool runs raw DSL queries. The description is specific about the API target, making it unmistakable.

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 gives explicit usage guidance: which index patterns to use, to use wildcard patterns rather than backing indices, to set track_total_hits for exact counts, and to use size:0 with aggregations. It also warns against the wrong approach (backing index) and provides concrete examples of patterns. It doesn't explicitly name sibling alternatives, but the 'when to use' guidance is so complete that an agent knows exactly when this tool is appropriate.

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

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/sec73/klaxon'

If you have feedback or need assistance with the MCP directory API, please join our Discord server