Skip to main content
Glama
MadameFabulous

Chainsaw MCP Server

Chainsaw: save custom rule

chainsaw_save_rule
Destructive

Save an analyst-authored Chainsaw detection rule to the custom rules directory and lint it, enabling hunting with extra_rules=['custom'].

Instructions

Save an analyst-authored Chainsaw rule into the custom rules directory.

Saved rules are hunted with extra_rules=['custom']. The file is linted before the result is returned; a failing lint still leaves the file in place so it can be fixed with another save using overwrite=true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lintNoRun chainsaw lint on the saved file.
nameYesFile name without directories, e.g. suspicious_rdp_from_workstation
overwriteNoReplace an existing custom rule.
yaml_textYesComplete Chainsaw rule YAML with title, group, description, authors, kind, level, status, timestamp, fields and filter. See the chainsaw://docs/rule-format resource.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, but the description adds non-obvious behavior beyond them: linting runs before the result is returned, and a failing lint leaves the file on disk rather than rolling back, recoverable only via overwrite=true. That partial-failure semantics is exactly the kind of detail an agent cannot get from structured fields.

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?

Three short sentences, no filler, with the core action front-loaded and the failure-recovery caveat following immediately. Every sentence carries distinct operational information.

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 write tool with no output schema, the description covers the critical edge case (failed lint still persists the file) and the overwrite remedy, which is what an agent most needs. It stops short of describing the returned result shape or the exact file path, but neither is essential to invoke it correctly.

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 name, yaml_text, lint, and overwrite, including defaults. The description only reiterates overwrite=true as the repair path and confirms lint behavior, adding marginal meaning beyond the schema — baseline 3 is appropriate.

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 (save), resource (analyst-authored Chainsaw rule), and destination (custom rules directory), which cleanly separates it from siblings like chainsaw_delete_rule, chainsaw_get_rule, and chainsaw_lint_rules. An agent can identify the operation without opening the schema.

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 implies the authoring workflow by explaining that saved rules are hunted with extra_rules=['custom'], which is useful downstream context, but never states when to choose this over alternatives or what preconditions apply (e.g. rule must be valid YAML, prior search_rules lookup). Usage is inferable rather than explicit.

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