Skip to main content
Glama

reverse_convert

Convert a Lucene or SIEM query into a draft Sigma rule (YAML) for review, adding required metadata like title, level, and logsource.

Instructions

Reverse-convert a SIEM query into a draft Sigma rule (YAML). dialect selects the source query language (lucene today, the Lucene / Elasticsearch query_string subset: field:value with wildcards, quoted phrases, /regex/, [a TO b] ranges, comparison shorthand, field:(a OR b) groups, exists, keyword terms, and AND/OR/NOT with grouping). A query carries no metadata, so pass title/id/level/status and at least one of logsource_product/category/service, which a Sigma rule requires; the result is a reviewable skeleton. Boosting, fuzzy/proximity, and non-numeric ranges are reported as errors.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoRule id (UUID).
levelNoRule level: informational, low, medium, high, or critical.
queryYesThe query to convert.
titleNoRule title (recommended; a query has no title of its own).
statusNoRule status: stable, test, experimental, deprecated, or unsupported.
dialectNoSource query dialect. Defaults to `lucene` (the only dialect today).
logsource_productNoLogsource product (e.g. windows).
logsource_serviceNoLogsource service (e.g. sysmon).
logsource_categoryNoLogsource category (e.g. process_creation).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.21.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that the output is a reviewable draft skeleton rather than a finished rule, and that boosting, fuzzy/proximity and non-numeric ranges surface as errors. It stops short of describing permissions, side effects, or whether anything is persisted.

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?

Front-loaded with the action and target in the first clause, then supporting detail. The long parenthetical enumerating the Lucene subset is dense but earns its place by defining the accepted dialect; nothing is padding.

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?

Nine parameters, no output schema, and no annotations, so the description must cover a lot and mostly does: purpose, dialect scope, mandatory metadata, draft output nature, and error behavior. Only the concrete shape of the returned YAML skeleton and any file-write behavior remain unstated.

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

Parameters4/5

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

Schema coverage is 100% (baseline 3), but the description adds real meaning: it spells out the accepted Lucene subset (field:value, wildcards, quoted phrases, /regex/, [a TO b], field:(a OR b), _exists_), and explains that at least one logsource_* is needed because a Sigma rule requires it, which upgrades the schema's neutral 'e.g.' hints.

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 opening sentence gives a specific verb (reverse-convert), a specific source resource (a SIEM query), and a specific target (a draft Sigma rule in YAML). The 'reverse-' prefix implicitly distinguishes it from the sibling convert_rules, so an agent can route correctly without opening 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?

It establishes the context clearly: use this when you have a SIEM query and need a Sigma rule, with `dialect` selecting the source language (lucene only today). It also states the required accompanying metadata, but never names an explicit alternative tool or a when-not-to-use condition.

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