Skip to main content
Glama

add_rule

Specify a trigger and action to enforce AI behavior rules at company, team, or personal scope. Set priorities and overrides for consistent, context-aware responses across any topic.

Instructions

Add a behavioral rule to CarryMem's rule engine. Rules guide AI behavior for specific topics. Use 'company' scope for organization-mandated rules (highest priority), 'negotiated' for team-adapted rules, or 'personal' for individual preferences (lowest priority).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNoRule scope: company (org-mandated, cannot be overridden), negotiated (team-adapted), personal (individual preference)personal
actionYesWhat to do when triggered (e.g., 'Always use SSL', 'Never commit secrets')
triggerYesTopic/scene that activates this rule (e.g., 'database', 'code review', 'security')
overrideNoWhether this rule overrides conflicting lower-scope rules
rule_typeNoRule type: always (mandatory), avoid (discouraged), forbid (prohibited), prefer (recommended), format (output formatting directive)always

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.11.2
    • changedInput schema / properties / rule_type / description
      Previous value: -"Rule type: always (mandatory), avoid (discouraged), forbid (prohibited), prefer (recommended), recommend (suggested)"New value: +"Rule type: always (mandatory), avoid (discouraged), forbid (prohibited), prefer (recommended), format (output formatting directive)"
    • changedInput schema / properties / rule_type / enum
      Previous value: -[
      -  "always",
      -  "avoid",
      -  "forbid",
      -  "prefer",
      -  "recommend"
      -]New value: +[
      +  "always",
      +  "avoid",
      +  "forbid",
      +  "prefer",
      +  "format"
      +]
  2. First observedv0.4.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the priority semantics of scopes (company highest, personal lowest) and mentions that company rules are org-mandated and cannot be overridden. However, it doesn't disclose potential side effects, such as whether adding a rule immediately affects AI behavior, whether rules can be overridden by other rules, or what happens when conflicting rules exist. The description adds some value but leaves important behavioral questions unanswered.

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?

The description is concise and front-loaded with the core purpose. The first sentence states the action and resource, and the second sentence explains the scope options. It's efficient with no wasted words, though it could arguably be slightly more structured with the scope explanation, but it's well within acceptable bounds.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 5 parameters, 2 required, and no output schema. The description covers the core purpose and scope semantics, and the schema covers all parameters. However, for a tool that creates persistent rules affecting AI behavior, the description doesn't explain what happens after adding a rule (e.g., immediate effect, conflict resolution, how to verify it was added). Given the complexity of the rule engine and the lack of annotations, the description is adequate but not complete.

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 all five parameters thoroughly. The description adds context about scope priority and rule semantics, but it doesn't add significant meaning beyond what the schema provides. The baseline of 3 is appropriate since the schema does the heavy lifting, and the description's scope explanation is a modest addition.

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?

The description clearly states the tool's purpose: adding a behavioral rule to CarryMem's rule engine. It specifies the resource (rule engine), the action (add), and the domain (behavioral rules guiding AI behavior for specific topics). It also distinguishes the three scope types, which helps differentiate from sibling tools like update_rule, delete_rule, and list_rules.

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?

The description provides clear context on when to use this tool: when adding a behavioral rule. It explains the three scope options and their priority levels, which is essential for correct usage. However, it doesn't explicitly state when NOT to use this tool or mention alternatives like update_rule for modifying existing rules, so it falls slightly short of a 5.

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