Skip to main content
Glama

parse_rule

Convert Sigma YAML rules, correlations, and filters into a structured JSON AST, or return structured syntax errors. Accepts inline YAML or a file path.

Instructions

Parse Sigma YAML (rules, correlations, filters; multi-document supported) into a structured AST as JSON, or return structured parse errors. Accepts inline yaml or a file path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoPath to a Sigma YAML file (or directory, where the tool supports it). Mutually exclusive with `yaml`. Resolved against `--rules-dir` when relative, and must stay inside it when one is configured.
yamlNoInline Sigma YAML (single or multi-document). Mutually exclusive with `path`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.23.0
    • changedInput schema / properties / path / description
      Previous value: -"Path to a Sigma YAML file (or directory, where the tool supports it).\nMutually exclusive with `yaml`. Resolved against `--rules-dir` when relative."New value: +"Path to a Sigma YAML file (or directory, where the tool supports it).\nMutually exclusive with `yaml`. Resolved against `--rules-dir` when\nrelative, and must stay inside it when one is configured."
  2. First observedv0.20.0

TDQS

A4/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 the return shape (structured AST as JSON, or structured parse errors), multi-document support, and both input modes. It omits whether the operation is purely read-only and any directory-resolution caveats, but the behavior relevant to invoking it correctly is disclosed.

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?

A single tight sentence that front-loads the core action and packs the accepted formats and output shape without redundancy. Every clause earns its place.

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?

No output schema exists, and the description covers the return value (AST JSON or structured errors), inputs, and multi-document handling. The only gap is the behavior when neither optional input is supplied (both are optional, 0 required), which is left unstated.

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 the schema already documents the mutual exclusivity and path resolution rules in detail. The description's 'inline yaml or a file path' adds nothing beyond that, 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 ('Parse Sigma YAML ... into a structured AST as JSON') and enumerates what it handles (rules, correlations, filters; multi-document). This clearly distinguishes it from siblings like lint_rules, validate_rules, and convert_rules, which also touch Sigma rules.

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

Usage Guidelines3/5

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

It states the accepted input modes (inline `yaml` or file `path`), which implies when to use it, but gives no explicit when-to-use versus validate_rules/lint_rules/parse_condition, and no prerequisites or exclusions. Usage is implied rather than guided.

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