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 is suspended automatically after at least 5 explicit ratings when the 95% Wilson upper bound of its success rate is below 0.4. 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" | "followed" | "report" — —
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[] — —
surface_idNew in 14.9.0 string — For followed: surface_id returned by self_rules_context
followedNew in 14.9.0 boolean | null — For followed: true followed, false ignored, null clears
noteNew in 14.9.0 string "" For followed: evidence note
applicableNew in 14.9.0 boolean true For followed: false marks the rule not applicable
min_nNew in 14.9.0 integer 5 For report: judged surfaces needed before a verdict (min 1)

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, ci_upper}. followed records whether a rule shown by self_rules_context(query=...) was followed; report gives follow rates with 95% Wilson intervals and never changes a rule's status.

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 v15.0.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, followed (surface_id from self_rules_context(query=...): was the rule followed?), report (follow-rate effectiveness with Wilson CIs, measurement only). success_rate = success / (success + fail). Auto-suspend: 5+ ratings and the 95% upper bound of success_rate < 0.4.

Found a mistake? Open an issue on GitHub.

Search