Skip to main content
Glama

create_rule

Create a NEW product rule (an Attribute Rule). GUARDRAIL: a Rule is NEVER a substitute for per-product enrichment — if you would need MORE THAN 3 text-contains conditions (contains/contains_any/starts_with on a description/title) to derive a value (color, material, gender…), do NOT create a Rule; enrich instead with set_api_source/set_ai_source and map that source attribute (see the server ENRICH guidance). A Rule patches FEED OUTPUT only and writes NOTHING onto the products; if the user asked to enrich the products / add attribute X to the products, use set_api_source/set_ai_source (or ask first) — never substitute a Rule. ALWAYS validate_rule it first and fix every error. 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 discover_rule_operations for the vocabulary). Any _id/id you include is IGNORED — the server always mints a new one (this tool never overwrites an existing rule; use update_rule for edits). scope selects where it is created: 'project' (default) = the project's own library; 'shared_template' = the reusable shared template library (a template_read_only error means your access cannot write there). Returns {ruleId, scope, status, changed, reason, validation}; status 'created' on success, or 'rejected' with the validation errors when the rule is invalid (HTTP 200, nothing written). SAVE-ONLY: a new rule has NO effect on any feed until you attach it to a feed attribute with map_feed_attribute (rule_id) and then export_feed; a shared_template rule affects no feed at all until it is used by a project. VALUE/OPTIONS MAPPING: for a map_attribute_value operation, search and replace are arrays of {value:''} objects paired by index (NOT plain strings — plain strings save but map nothing, showing empty rows); replace optional. That op is not executed by validate_rule's dry-run (passthrough computedValue) — verify only after a real export/build. project_id is OPTIONAL (inferred for a single-project customer; project_id_required otherwise — then call list_projects).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ruleYes
scopeNoWhere to create the rule: 'project' (default) = the project's own library; 'shared_template' = the reusable shared template library.
project_idNo

TDQS

A5/5.0
Behavior5/5

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

Annotations only state readOnlyHint/idempotentHint/destructiveHint all false; the description adds substantial behavioral context: rules write nothing onto products, included _id/id is ignored, the server always mints a new id, the tool never overwrites, invalid rules return HTTP 200 with status 'rejected', and new rules have no feed effect until attached and exported. 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?

Long, but appropriately so for a complex creation tool with many failure modes. It is front-loaded with purpose and guardrail, uses labeled sections (GUARDRAIL, SAVE-ONLY, VALUE/OPTIONS MAPPING), and every block addresses a distinct pitfall an agent would otherwise hit. Dense and structured rather than padded.

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?

There is no output schema, so the description carries the return contract: {ruleId, scope, status, changed, reason, validation}. It also covers project_id inference, dry-run limitations, value mapping array semantics, and post-create attachment workflow. An agent has everything needed to invoke this tool correctly and avoid common mistakes.

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 only 33%, but the description compensates fully. It supplies the complete nested rule document shape, explains that scope has 'project' as default and the shared_template behavior including template_read_only error, and clarifies project_id is optional/inferred unless required. This goes well beyond the sparse 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?

Opens with a specific verb and resource: 'Create a NEW product rule (an Attribute Rule).' It is clearly distinguished from siblings like update_rule, delete_rule, and validate_rule by explicitly saying edits use update_rule and validation is a prerequisite. The purpose is unmistakable.

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?

Provides emphatic when-not-to-use guidance: do not create a Rule for complex per-product enrichment; use set_api_source/set_ai_source instead; validate_rule first; use map_feed_attribute/export_feed to give it effect; use update_rule for edits. Alternatives and exclusions are explicit and actionable.

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