Skip to main content
Glama

fix_rules

Apply safe auto-fixes (lowercase keys, status/level typos, duplicate removal, ...) to Sigma YAML, preserving comments and formatting. Returns the fixed YAML and applied/failed/skipped-unsafe counts. Unsafe fixes are never auto-applied.

Instructions

Apply safe auto-fixes (lowercase keys, status/level typos, duplicate removal, ...) to Sigma YAML, preserving comments and formatting. Returns the fixed YAML and applied/failed/skipped-unsafe counts. Unsafe fixes are never auto-applied. With write: true (only valid with a file path, and only when the server runs with --rules-dir) the change is persisted to disk. Optional lint_rules restricts which lint rules are fixed.

Input Schema

NameRequiredDescriptionDefault
pathNoPath to a single Sigma YAML file. Mutually exclusive with `yaml`.
yamlNoInline Sigma YAML. Mutually exclusive with `path`.
writeNoPersist the fixed YAML back to disk. Only valid with a `path` input, and only when the server has a rules root (`--rules-dir`).
lint_rulesNoRestrict fixes to these lint rule ids (e.g. `non_lowercase_key`). Empty means apply every available safe fix.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.25.0
    • changedInput schema / properties / write / description
      Previous value: -"Persist the fixed YAML back to disk. Only valid with a `path` input."New value: +"Persist the fixed YAML back to disk. Only valid with a `path` input,\nand only when the server has a rules root (`--rules-dir`)."
  2. First observedv0.20.0

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden, and it does well: it discloses that comments/formatting are preserved, that unsafe fixes are never auto-applied, what counts are returned, and the prerequisites for writing to disk. It stops short of covering idempotency or failure behavior when a file is unwritable.

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?

Four dense sentences, front-loaded with purpose, then return values, then the safety guarantee, then the write constraint. Every clause carries information; 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?

For a mutation tool with no annotations and no output schema, the description covers return shape, safety guarantees, and write prerequisites. The main remaining gap is error/edge-case behavior (e.g., what happens with neither path nor yaml supplied), which is minor given the 100% schema coverage.

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%, so the baseline is 3, but the description adds a cross-parameter constraint the schema only hints at: write is only valid together with path and requires a server-level --rules-dir. It also clarifies lint_rules' semantics beyond the schema's example, adding real value.

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?

Opens with a specific verb+resource ('Apply safe auto-fixes ... to Sigma YAML') and enumerates the fix categories in parentheses. It is clearly distinguishable from siblings like lint_rules and validate_rules because it states it applies fixes rather than only reporting them.

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?

States the enabling condition for persistence ('write: true ... only valid with a file path, and only when the server runs with --rules-dir') and how to narrow scope via lint_rules. It doesn't explicitly name validate_rules or lint_rules as the read-only alternatives, so the when-not guidance is implied rather than spelled out.

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