Skip to main content
Glama

Add a standing rule

add_rule
Idempotent

Saves a standing rule for connected tools to follow, scoped to everywhere, a project, or a situation. Attach supporting memory or fact IDs so the rule is rechecked when that evidence goes stale.

Instructions

Add one standing rule that the owner wants every connected tool to follow. Use only when the owner asked for a rule; check list_rules first. An identical rule is not added twice. Pass the ids of the memories or facts the rule rests on so it can be flagged for re-check when they go stale. The owner then syncs rules to tools from the Rules page. Use save_memory for a one-off fact instead. Returns "Rule saved (id)." or "That rule already exists (id)."; text over 800 characters is rejected.

Input Schema

NameRequiredDescriptionDefault
thenYesThe rule itself, imperative, at most 800 characters. Required.
whenNoOptional situation in which the rule applies. Default: always.
scopeNameNoName of the project or situation. Required when scopeTier is project or situation.
scopeTierNoWhere the rule applies. Default everywhere.
evidence_fact_idsNoOptional ids of facts this rule is based on, as shown by search or fact_history. Stored as the rule's evidence; unknown ids are an error.
evidence_memory_idsNoOptional ids of memories this rule is based on, as shown by search. Stored as the rule's evidence; unknown ids are an error.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.5
    • addedInput schema / properties / evidence_fact_ids
      Added value: +{
      +  "description": "Optional ids of facts this rule is based on, as shown by search or fact_history. Stored as the rule's evidence; unknown ids are an error.",
      +  "items": {
      +    "type": "number"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / evidence_memory_ids
      Added value: +{
      +  "description": "Optional ids of memories this rule is based on, as shown by search. Stored as the rule's evidence; unknown ids are an error.",
      +  "items": {
      +    "type": "number"
      +  },
      +  "type": "array"
      +}
  2. Changed4 schema fields changedv0.1.3
    • addedInput schema / properties / scopeName / description
      Added value: +"Name of the project or situation. Required when scopeTier is project or situation."
    • addedInput schema / properties / scopeTier / description
      Added value: +"Where the rule applies. Default everywhere."
    • addedInput schema / properties / then / description
      Added value: +"The rule itself, imperative, at most 800 characters. Required."
    • addedInput schema / properties / when / description
      Added value: +"Optional situation in which the rule applies. Default: always."
  3. First observedv0.1.2

TDQS

A4.5/5.0
Behavior4/5

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

Adds real behavior beyond the annotations: adding a rule does not apply it to tools — the owner must sync from the Rules page — and duplicate rules are silently skipped with a distinct message. Annotations already cover safety (idempotent, non-destructive, closed-world), so the remaining gap is modest: no detail on what happens to the stored rule if evidence memories are later deleted.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and conditions are front-loaded in the first sentence, and no sentence is filler — dedup, sync, alternative tool, and return strings each carry distinct information. It is somewhat dense in the back half, cramming return values, errors, and the sync flow together.

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?

With no output schema, the description correctly supplies the two return strings and the rejection case. It also documents the post-write sync step an agent otherwise would not know about. Minor omission: nothing about what happens when evidence memories later go stale or are deleted, beyond the flag existing.

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; the description earns above that by explaining the purpose of evidence_fact_ids/evidence_memory_ids — they let the rule be flagged for re-check when those memories go stale. It also restates the 800-character cap on the rule text. Scope-tier semantics are left entirely to the schema.

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 ('Add one standing rule') plus the audience/scope ('that the owner wants every connected tool to follow'). It is clearly separable from siblings like save_memory, list_rules, and confirm_rule, each of which is either named or implied as a different step.

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

Usage Guidelines5/5

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

Gives an explicit precondition ('Use only when the owner asked for a rule'), a sequencing instruction ('check list_rules first'), and a named alternative for the adjacent case ('Use save_memory for a one-off fact instead'). When-to-use, when-not, and the alternative are all spelled out.

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