Skip to main content
Glama

Create ad matching rule

create_ad_mapping_rule
Destructive

Create Ad Mapping

When to use: 새 광고 매칭 규칙(소재 조건 → 대상상품)을 하나 만들어 저장할 때. 이후 수집되는 광고행은 이 규칙으로 자동 귀속된다.

When NOT to use: 기존 규칙의 내용이나 순서를 바꾸려면 update_ad_rule_mapping 을 규칙마다 한 번씩 부른다. 규칙 삭제는 delete_ad_mapping_rule. 규칙을 만들지 않고 개별 건만 손보려면 update_ad_relation.

Limitations: 생성 전용 — 기존 규칙을 갱신하지 않는다(항상 새 규칙). 필수 필드는 mapping_name·mapping_products·mapping_rule 셋이다. mapping_rule 은 레거시 AST(_typeTag: BinFunction/And/Or, 리프는 lhs·_functionName·rhs)이고 mapping_rule_fe 는 화면 표현이다 — 조회·집계는 mapping_rule_fe 를 먼저 보고 없을 때만 AST 로 폴백하므로, 둘을 같은 조건으로 함께 넘겨야 화면과 실제 매칭이 어긋나지 않는다. mapping_products 항목은 product_id·brand_name·channel_name·shop_id 를 갖는다. 저장 전에 count_ad_rule_matches 로 조건이 잡는 광고행 수를, preview_ad_rule_category 로 대상상품의 기초상품카테고리를 확인할 것을 강력히 권한다 — substring 조건은 의도보다 넓게 잡히기 쉽다(예: 브랜드 약어가 타 브랜드 소재명에 부분일치). priority 를 지정하면 같은 값 이상의 기존 규칙들이 뒤로 밀린다. data_management:write 권한 필요. data_mapping+AD 스코프 감사 이벤트로 기록된다.

Examples:

  • Q: 광고 이름에 '여름세일'이 들어가면 '수분크림 50ml' 상품으로 잡는 규칙을 만들어줘 params: {'body': {'mapping_name': '여름세일', 'mapping_products': [{'product_id': '1001', 'product_name': '수분크림 50ml', 'brand_name': '브랜드A', 'channel_name': '스마트스토어', 'shop_id': 1}], 'mapping_rule': {'_typeTag': 'BinFunction', 'lhs': 'ad_name', '_functionName': 'LIKE', 'rhs': '여름세일'}, 'mapping_rule_fe': {'advancedFilters': {'subFilters': [{'conditions': [{'column': 'ad_name', 'operator': 'LIKE', 'values': ['여름세일']}]}]}}}}

Output shape: string: 생성 결과 식별자

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": {
      "mapping_name": "<mapping_name>",
      "mapping_products": "<mapping_products>",
      "mapping_rule": "<mapping_rule>"
    },
    "name": "create_ad_mapping_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
priorityNo
project-idNo
auth_methodNojwt
mapping_nameYes
mapping_ruleYes
mapping_rule_feNo
mapping_productsYes
distribution_policy_idNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnly=false, destructive=true, openWorld=false; the description adds substantial context beyond them: create-only semantics (never updates an existing rule), the side effect that specifying priority pushes existing rules of equal-or-higher priority back (which explains the destructiveHint), the data_management:write permission requirement, and the audit event recorded (data_mapping+AD scope). It also warns about substring conditions matching more broadly than intended.

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?

Header-labelled sections (When to use / When NOT / Limitations / Examples) make it easy to scan, and the required-field constraint is bolded and front-loaded. It is long and mixes English headers with Korean prose plus escaped backticks, which adds some visual noise, but nearly every sentence carries operational information.

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 an 8-param, nested-object, destructive mutation with an output schema, the description covers creation semantics, required fields, cross-field consistency rules, pre-flight checks, priority side effects, and permissions. The output schema and the one-line return note cover the response, so no return-value detail is missing.

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?

With 0% schema description coverage across 8 params including nested objects, the description carries the burden and largely succeeds: it names the three required fields, specifies the AST leaf shape (_typeTag, lhs, _functionName, rhs), explains the mapping_rule vs mapping_rule_fe fallback relationship and why both must be supplied consistently, and lists mapping_products item fields. It still leaves project-id, auth_method, distribution_policy_id, and shop_name/product_name unexplained.

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 states a specific verb and resource ('새 광고 매칭 규칙(소재 조건 → 대상상품)을 하나 만들어 저장') and even clarifies the downstream effect (newly collected ad rows get auto-attributed). It distinguishes itself from update_ad_rule_mapping, delete_ad_mapping_rule, and update_ad_relation by name, so an agent can route without opening sibling schemas.

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?

Explicit 'When to use' and 'When NOT to use' sections name each alternative and the condition that selects it (editing existing rules → update_ad_rule_mapping per rule; deleting → delete_ad_mapping_rule; ad-hoc fixes → update_ad_relation). It also recommends a pre-flight verification flow with count_ad_rule_matches and preview_ad_rule_category, which is exactly the routing guidance an agent needs.

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