Skip to main content
Glama

Update Rule

lexq_rules_update
Destructive

Update an existing rule in a DRAFT version. Only provided fields are changed. A new condition tree must stay within 25 conditions (SINGLE nodes) and 10 levels of nesting below the root. Saving re-checks every action in the rule, including ones you did not change. Saving fails with P-064 if a value in the new condition tree or in any action is over the value limits that lexq_rules_create lists, with ACT-032 if an action's targetVar is not a registered fact, with ACT-035 if a MUTATE_FACT uses a registered fact that is not a NUMBER fact, and with ACT-036 if a SET_FACT value does not match the data type of its targetVar. Adding a mutexGroup to a rule without one also sets mutexMode to EXCLUSIVE unless the request sends mutexMode. Changing an existing mutexGroup to another key keeps the saved mutexMode. A request that changes the mutexGroup or mutexMode and leaves the rule with a mutexGroup and mutexMode NONE fails with P-067.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "groupId": "<groupId>",
      "versionId": "<versionId>",
      "ruleId": "<ruleId>",
      "rule": "<rule>"
    },
    "name": "lexq_rules_update"
  }
}

Input Schema

NameRequiredDescriptionDefault
ruleYesJSON string of UpdateRuleRequest: { name?, condition?, actions?, mutexGroup?, mutexMode?, mutexStrategy?, mutexLimit?, isEnabled? }
ruleIdYesRule ID
groupIdYesPolicy group ID
versionIdYesVersion ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the annotations (destructiveHint=true, readOnlyHint=false), it discloses real behavioral traits: the whole rule is re-validated on save including untouched actions, and specific failure codes are enumerated (P-064, ACT-032, ACT-035, ACT-036, P-067). It also documents non-obvious side effects, such as mutexGroup being added auto-setting mutexMode to EXCLUSIVE and changed mutexGroup keys preserving the saved mutexMode.

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 partial-update semantics are front-loaded, then constraints and failure modes follow in descending order of importance. The error-code sentences are dense and information-heavy rather than padded, though the single long block of conditional mutex rules could be broken up for scanability.

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

Completeness5/5

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

For a destructive mutation with no output schema, the description covers the critical gaps: partial-update behavior, validation scope, limit violations, and mutex side effects. Only the success response shape and any versioning/permission prerequisites are left unaddressed, which is minor given the 100% schema description coverage.

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 description coverage is 100%, so the baseline is 3, but the description adds genuine meaning about the `rule` payload: all fields are optional and only supplied ones mutate, and a new condition tree must respect 25 SINGLE nodes and 10 nesting levels. It also explains the mutexGroup/mutexMode interaction that constrains what values are legal, which the schema does not convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ('Update an existing rule') plus a scope qualifier ('in a DRAFT version') and a partial-update semantic ('Only provided fields are changed'). The reference to lexq_rules_create for value limits implicitly separates this tool from creation, but there is no explicit contrast with overlapping siblings such as lexq_rules_toggle, even though isEnabled is editable here.

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?

It clearly establishes the context of use: an existing rule in a DRAFT version, patching only supplied fields, and it routes the reader to lexq_rules_create for the value limits that govern validation. It does not say when to prefer this over lexq_rules_toggle or lexq_rules_create, and no explicit exclusions are given.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.