Skip to main content
Glama

validate_rule

Read-onlyIdempotent

Validate a product rule (Attribute Rule) WITHOUT saving it. Use this to check a rule before create_rule / update_rule and fix every error first. Pass the full rule document as rule — {name, description, category, icon, rules:[{sortId, enabled, type, conditions, operationGroups:[{mode, parentMode, attributes, operations: [{name, arguments:{key:value}}]}]}]} (see list_rule_transforms for the transform-step/condition/argument vocabulary). Returns {valid, errors:[{path, code, message}], warnings:[{path, code, message}], dryRun}. Errors are blocking — the rule will be rejected on save; warnings are advisory. If you also pass a sample_product (a flat {attributeCode:value} record, e.g. from preview_products) and the rule is structurally valid, the server dry-runs it and returns dryRun:{matchedRuleSortId, computedValue, usedAttributes} so you can confirm the output before saving. This tool never writes. project_id is OPTIONAL (inferred for a single-project customer; project_id_required otherwise — then call list_projects). The dry-run runs in memory and calls nothing outside Koongo. When you do NOT pass sample_product, the server auto-samples a real product to compute dryRun, so the computedValue is real data returned only after you set acknowledge_sensitive:true: the first such call (flag absent/false) returns {sensitiveGate:{confirmationRequired:true, itemCount, fields, kind}} with the computedValue EMPTY — present that gate to the USER, get their approval, then re-call with acknowledge_sensitive:true. (If you passed your own sample_product you already hold that data, so no gate applies and the computedValue is returned directly.) DRY-RUN LIMITATION: AI-group transform steps — notably map_attribute_value (value/options mapping) — are NOT executed by the dry-run. It returns valid:true with computedValue = the input UNCHANGED (passthrough) even when the mapping is correct; this is expected, not a bug, so do NOT treat the unchanged value as a failure. Verify a value/options mapping only AFTER a real build/export: feed → export_feed then verify_feed_attributes; marketplace/ad → repair_marketplace / submit_all_marketplace_items (or the ad equivalents) then get_*_report.

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": {
      "rule": "<rule>"
    },
    "name": "validate_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
ruleYesThe full rule document (stored configuration data) — {name, description, category, icon, rules:[{sortId, enabled, type, conditions, operationGroups:[{mode, parentMode, attributes, operations:[{name, arguments}]}]}]}. `operations` holds pure value-transform steps (see list_rule_transforms) that Koongo applies to the attribute value when it builds a feed; they are data, never actions this tool runs.
project_idNo
sample_productNoA flat {attributeCode:value} record (e.g. from preview_products) to dry-run the rule against; when omitted the server auto-samples a real product.
acknowledge_sensitiveNoSet true only AFTER the user approves seeing real data. Only relevant when the server auto-samples (no sample_product given): absent/false returns a sensitiveGate with computedValue empty; true returns it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / rule / description
      Added value: +"The full rule document (stored configuration data) — {name, description, category, icon, rules:[{sortId, enabled, type, conditions, operationGroups:[{mode, parentMode, attributes, operations:[{name, arguments}]}]}]}. `operations` holds pure value-transform steps (see list_rule_transforms) that Koongo applies to the attribute value when it builds a feed; they are data, never actions this tool runs."
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds real depth beyond them: the dry-run runs in memory and calls nothing outside Koongo, errors block while warnings are advisory, the sensitive-data gate returns an empty computedValue until acknowledge_sensitive:true, and the AI-group transform passthrough limitation is called out as expected rather than a bug.

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

Conciseness3/5

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

The opening sentence is front-loaded and effective, but the body is a dense ~300-word block mixing the gate workflow, the dry-run limitation, and multi-step verification recipes. Nearly every sentence carries information, yet the parenthetical asides and repeated rule-shape restatement make it harder to scan than it needs to be.

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 complex tool with no output schema, the description fully documents the return shapes ({valid, errors:[{path, code, message}], warnings, dryRun} and {sensitiveGate:{confirmationRequired, itemCount, fields, kind}}) plus the two-stage approval flow, leaving nothing an agent needs in order to call it correctly.

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?

At 75% schema coverage the schema already documents rule and sample_product, but the description adds the full nested rule shape, the flat {attributeCode:value} semantics for sample_product (e.g. from preview_products), and the project_id inference rule (inferred for single-project customers, otherwise project_id_required → list_projects). acknowledge_sensitive is covered by both. Strong, though the rule shape duplicates the schema text somewhat.

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 — "Validate a product rule (Attribute Rule) WITHOUT saving it" — and immediately frames its relationship to create_rule/update_rule, so an agent can distinguish it from the sibling write tools without opening any schema.

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?

Explicitly prescribes the workflow: check a rule before create_rule/update_rule and fix every error first, and separately tells when this tool is insufficient (value/options mappings must be verified via export_feed + verify_feed_attributes or repair_marketplace/submit_all_marketplace_items + get_*_report). Exclusions and alternatives are both named.

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.

Resources