Skip to main content
Glama

discover_rule_operations

Read-only

Discover the vocabulary for building a product rule (an attribute-value transformation — the feature Koongo's UI and help call "Attribute Rules" / "Rules"). GUARDRAIL: a Rule must never be keyword-matching — if a value would need MORE THAN 3 text-contains conditions to derive (color, material, gender… from free text), STOP and enrich per-product with set_api_source/set_ai_source instead of building the Rule. A Rule patches FEED OUTPUT only and writes NOTHING onto the products; if the user asked to enrich the products, use set_api_source/set_ai_source (or ask first) — never substitute a Rule. Call this FIRST, before you write a rule, so you use only supported operations, conditions and arguments. Returns {operations:[{name, label, group, returnType, valueType, math, attributeVariant, arguments:[{name, label, type, required, options, placeholder, optionsSource}]}], conditions:[{operator, label, group, disabledFor, arguments}], ruleSchema, examples:[{title, description, rule, sampleProduct, expectedValue}]}. A rule document has the shape {name, description, category, icon, rules:[...]}. Each rule is {sortId (int, precedence — the server reassigns it 1,2,3… by position on save), enabled (bool), type, conditions (a condition tree, optional), operationGroups:[{mode, parentMode, attributes:[...], operations:[{name, arguments:{key:value}}]}]}. A rule's conditions (when present) is a combine node {type:"combine", operator:"and"|"or", conditions:[ {type:"expression", attribute, operator, value} | nested combine]} — a single condition is a combine wrapping one expression, and the comparison value always goes in the expression's value (an operator's arguments only describe that value's input). AUTHOR the unconditional "Default Rule" FIRST, then the "Conditional Rule" exceptions — the server normalizes to that shape and reassigns sortId 1,2,3…; among conditionals a lower sortId is evaluated first and the Default Rule (at most one) is the fallback. Match a condition value's type to its attribute: a numeric attribute (dataType integer/double from list_source_attributes) needs a NUMBER not a quoted string (the server casts on save), and a text operator (disabledFor includes "number": contains/starts_with/ length_exceeds/*_any/…) on a numeric attribute is REJECTED — use greater/less/equals instead. Operations in a group run left-to-right and chain by type: an op's valueType is its INPUT and returnType its OUTPUT, so each op's returnType must match the next op's valueType. The Rules help's text "Functions" (trim, upper/lower case, strip HTML, base64…) are the single textoperations operation via its function argument; collection "Functions" (sort, unique, join, first non-empty…) are the Collections-group operations. An operation's arguments object keys come from that operation's argument spec here; enum arguments accept only the listed options ids. Filter to one operation group with group; set detail 'full' for the complete argument specs and 'compact' (default) for a lighter list. include_conditions adds the condition operators; include_examples adds curated end-to-end worked examples. VALUE / OPTIONS MAPPING (the map_attribute_value operation) remaps a source attribute's store values onto a target/channel attribute's allowed set (the CP "store value → channel value" table). Its search and replace arguments are ARRAYS OF OBJECTS {value:''} paired by index (search[i] → replace[i], SAME length) — NOT plain-string arrays. Plain strings save without error but map nothing (empty rows in the UI, passthrough at runtime) — the #1 gotcha. replace is OPTIONAL (the CP "AI Mapping (unmapped)" autofills the rest) but provide it for deterministic output. A source value NOT listed in search passes through UNCHANGED (no implicit default), so for a CLOSED target allowed-value set either map EVERY value or add a Default Rule (set_value) fallback, otherwise unmapped values violate the channel spec. Place it in an operationGroup with mode:'single', attributes:['']. SET OPTION (the setoption operation) assigns an attribute a fixed value from its CLOSED option list: put it in an operationGroup mode:'set_option', attributes:[], operations:[{name:'setoption', arguments:{value: ''}}] — value is the option VALUE, not its label. More generally, an argument whose spec has optionsSource (e.g. 'feedAttribute') means its value must be one of the target attribute's options — read them with get_attribute_options. ALWAYS validate_rule a rule before create_rule / update_rule.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupNo
detailNo
include_examplesNo
include_conditionsNo

TDQS

A5/5.0
Behavior5/5

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

Annotations already carry readOnlyHint=true, but the description adds significant behavioral detail: a Rule writes nothing to products, the server reassigns sortId values, casts numeric values on save, and silently accepts mis-typed mapping arrays that result in no mapping. No contradiction with annotations.

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

Conciseness5/5

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

Although long, the description is dense and every major block (guardrail, returned shapes, condition trees, type matching, mapping gotchas, validation workflow) adds decision-relevant information for a complex tool. It front-loads the core purpose and guardrail before diving into details.

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?

With no output schema, the description supplies the complete return contract: operations, conditions, ruleSchema, examples, and the rule document and condition tree shapes. It also covers parameter effects, common failure modes, and the surrounding create/validate workflow, so an agent has what it needs to call the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description fully compensates: it explains group filtering, detail 'full' vs 'compact' behavior, include_conditions, and include_examples. It also explains argument spec semantics such as optionsSource, enum options, and array-of-object mapping arguments.

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 opens with a specific verb and resource: 'Discover the vocabulary for building a product rule' and defines the domain ('attribute-value transformation'). It clearly separates this from sibling write tools by instructing to call it FIRST before writing a rule.

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?

It gives explicit when-to-use guidance: call before create/update/validate and before writing any rule, so only supported operations/conditions/arguments are used. It also names alternatives and exclusions, including enriching products with set_api_source/set_ai_source instead of a Rule, and mandates validate_rule before create_rule/update_rule.

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.

TDQS

A4.2/5.0
Disambiguation4/5

Tools are organized around distinct resources (ads, marketplaces, feeds, orders, rules, sources) with clear action verbs, and descriptions explicitly disambiguate near-pairs like get_feed_status vs ad_status or set_feed_filter vs set_feed_attribute_filter. A few similarly named status/action pairs (e.g. ad_status vs get_ad, run_ad_item_action vs run_ad_operation) require careful reading, but overall the purposes are separable.

Naming Consistency4/5

The overwhelming majority follow a consistent verb_noun snake_case pattern (list_*, get_*, create_*, set_*, run_*, test_*). Minor deviations like ad_status and marketplace_status (noun-based status tools) and koongo_knowledge break the pattern slightly, but the convention is clearly recognizable and predictable.

Tool Count1/5

At 105 tools, the surface is extreme and far beyond the 50+ threshold, even for a complex e-commerce integration domain. Much of the bloat comes from systematic triplication across ads, marketplaces, and feeds (e.g. three nearly identical map_*_attribute tools, three list_*_items, three get_*_report) that a generic resource parameter could have consolidated.

Completeness4/5

The toolset covers the full lifecycle of feeds, ads, marketplaces, order connections, rules, and imports, including create/read/update/delete, status monitoring, item-level actions, validation, repair, and restore. Minor gaps exist, such as no delete for standalone order connections and limited update capabilities for some entities, but these are workable and do not create dead ends for the core workflows.

Resources