Skip to content
Docs menu

Tool reference · Errors, rules & self-improvement

self_rules

Manages behavioural rules: list them, record when one was used, rate whether it helped, and suspend, reactivate, retire or add rules by hand.

local stdio server writes
Caution. A rule rated after 10 or more uses with a success rate below 0.2 is suspended automatically. retire and suspend remove a rule from self_rules_context results.

When to use

  • You want to see the active rules for a project.
  • After a task, you want to rate whether a rule actually helped.
  • You want to add a rule directly without going through insights (action "add_manual").

Parameters

NameTypeDefaultDescription
actionrequired "list" | "fire" | "rate" | "suspend" | "activate" | "retire" | "add_manual" — —
id integer — Rule ID (for fire/rate/suspend/activate/retire)
success boolean — For rate: was rule helpful?
content string — Rule text (for add_manual)
category string — Category (for add_manual)
scope string "global" global | project:<name> | category:<name>
priority integer 5 1-10
project string "general" —
tags string[] — —

Example

Arguments

{
  "action": "add_manual",
  "content": "Always run the migration in a transaction on staging first.",
  "category": "config_error",
  "scope": "project:my-api",
  "priority": 7,
  "project": "my-api"
}

Result shape

{
  "added": true,
  "id": 19
}

Other actions return their own small objects, for example rate returns {rated, id, success_rate}.

Values are illustrative; the keys follow the server's handler. MCP clients receive the result as JSON text content.

Server description

The description the server sends to your agent in tools/list, captured from the v14.7.0 source:

Manage behavioral rules (SOUL). Rules are promoted insights that shape agent behavior. Actions: list, fire (record relevance), rate (success=true/false), suspend, activate, retire, add_manual. Auto-suspend: success_rate < 0.2 after 10+ fires.

Found a mistake? Open an issue on GitHub.

Search