Skip to main content
Glama

Update product matching rule

update_item_rule_mapping
Destructive

Update Rule Mapping

When to use: 상품 매칭 규칙 하나(seq)의 이름·조건·연결 기초상품·순서(priority)를 고칠 때. 순서를 바꾸는 것도 이 도구로 한다.

When NOT to use: 새 규칙은 create_item_mapping_rule. 규칙 삭제는 delete_item_mapping_rule. 여러 규칙을 고쳐야 해도 규칙마다 한 번씩 부른다 — 일괄 덮어쓰기 경로는 MCP 에 열려 있지 않다.

Limitations: path.seq 로 대상을 고른다(body 의 seq 는 무시된다). body 필드는 모두 선택이고 넘긴 필드만 바뀐다 — 다른 규칙의 내용은 건드리지 않는다. 조건을 바꿀 때는 mapping_rule 과 mapping_rule_fe 를 함께 넘긴다. 넘기지 않은 필드는 이전 값이 남으므로 mapping_rule 만 바꾸면 웹 편집 화면은 이전 조건을 계속 보여준다. mapping_item 을 빈 리스트로 주면 무시된다(연결 대상을 비울 수 없다). mapping_name 이 다른 상품 규칙과 겹치면 400, 없는 seq 는 404. priority 를 넘기면 상품 규칙 전체(MANUAL·EASYADMIN 기본 매핑 포함)를 priority 순서대로 1..n 으로 다시 매긴다 — 정렬 뒤 번호를 다시 매기므로 이 규칙은 그 값을 가졌던 규칙 바로 앞에 들어간다(같은 값이면 방금 수정한 규칙이 앞선다). 아래로 옮기면 이 규칙의 옛 자리가 비므로 준 숫자보다 한 칸 앞에 놓인다 — 규칙 X 뒤에 두려면 X 의 priority + 1 을 준다. 다른 규칙들의 priority 값도 바뀐다. priority 를 넘기지 않으면 순서는 그대로다. mapping_rule 은 규칙 AST 다(_typeTag: BinFunction/And/Or, 리프는 lhs·_functionName·rhs). lhs 는 옵션의 문자열 컬럼(brand_name·channel_name·product_id·product_name·option_id·option_name), _functionName 은 EQ·NE·IN·NOT_IN·LIKE·NOT_LIKE·START_WITH·END_WITH·NULL·NOT_NULL 을 쓴다. LIKE·NOT_LIKE 는 rhs 를 부분일치로 감싸고 % 와 _ 를 이스케이프하므로 rhs 에 % 를 넣지 않는다(넣으면 글자 % 를 찾는다). START_WITH·END_WITH 는 이스케이프하지 않아 % 와 _ 가 와일드카드로 동작한다(예: "50%" 는 50 으로 시작하는 모든 값에 매칭) — 이 둘의 rhs 에는 % 와 _ 를 피한다. 실제 매칭은 mapping_rule 로만 계산되고 mapping_rule_fe 는 웹 규칙 편집 화면의 표현이다 — 비우면 매칭은 되지만 웹 편집 화면에는 조건이 비어 보인다. 화면 형식이 필요하면 웹에서 만든 규칙을 get_item_rule_mapping 으로 읽어 같은 모양으로 넘긴다. mapping_item 은 연결할 기초상품 목록(item_brand_name·item_id·item_name·item_qty, is_gift 선택)이다. 쓰기 직전 상태는 복원 지점으로 따로 찍히지 않는다 — data_mapping+ITEM 스코프 이력 이벤트만 남고, 체크포인트는 다음 배치 주기에 변경 뒤 상태로 찍힌다. 되돌릴 기준점이 필요하면 쓰기 전에 create_restore_point(entity_type=data_mapping, entity_id=ITEM)로 먼저 복원 지점을 만든다. 되돌리기 자체는 MCP 도구로 열려 있지 않아 웹에서 한다(라플라스 웹 데이터 관리 화면의 「버전 히스토리」). 복원은 규칙 하나가 아니라 상품 매칭 규칙(ITEM) 전체를 그 시점으로 되돌린다 — 복원 지점 뒤에 만들거나 고친 다른 상품 규칙도 함께 되돌아간다. priority 는 숫자가 작을수록 먼저 적용된다. 저장하면 데이터 마트 갱신 요청이 나간다. 매칭 결과(파생 테이블)에 바로 반영하려면 규칙을 모두 고친 뒤 refresh_cogs_relation을 한 번 부른다. data_management:write 권한 + ITEM_MAPPING 스코프 필요.

Examples:

  • Q: 이 상품 매칭 규칙 이름을 '수분크림 50ml 규칙'으로 바꿔줘 params: {'path': {'seq': 12}, 'body': {'mapping_name': '수분크림 50ml 규칙'}}

  • Q: 이 상품 매칭 규칙을 두 번째 순서로 옮겨줘 params: {'path': {'seq': 12}, 'body': {'priority': 2}}

Output shape: no content (성공 시 body 없음)

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": {
      "seq__path": "<seq__path>"
    },
    "name": "update_item_rule_mapping"
  }
}

Input Schema

NameRequiredDescriptionDefault
seqNo
priorityNo
seq__pathYes(Path parameter)
project-idNo
auth_methodNojwt
mapping_itemNo
mapping_nameNo
mapping_ruleNo
mapping_rule_feNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only declare destructiveHint=true and openWorldHint=false; the description adds far more — path.seq vs ignored body.seq, partial-update semantics ('넘긴 필드만' changes), an empty mapping_item being silently ignored, 400 on name collision and 404 on missing seq, the priority renumbering side effect across ALL product rules, checkpoint timing, and the fact that restore reverts the entire ITEM rule set. It also documents escaping quirks in LIKE vs START_WITH/END_WITH, which no annotation or schema conveys.

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?

The structure is strongly front-loaded — purpose, when-to-use, when-not, limitations, examples, output shape — and nearly every sentence conveys a non-obvious constraint. It is nonetheless very dense and some of the restore/checkpoint narrative could be compressed or moved to create_restore_point's own definition, costing a point on tightness.

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 9-parameter destructive mutation with 11% schema coverage and no output schema, the definition supplies everything an agent needs: target selection, partial-update rules, error codes, side effects on other rules, permission/scope requirements, the explicit 'no content on success' return, and worked examples. Nothing material is left to inference.

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 11%, so the description must carry the burden and it does: it explains seq__path vs body seq precedence, the mapping_rule AST shape (_typeTag, lhs column whitelist, _functionName operator list with LIKE/START_WITH escaping rules), mapping_rule_fe's display-only role, mapping_item's per-entry fields, and priority's 1-based renumbering semantics. This is meaning well beyond what the bare schema exposes.

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+resource ('상품 매칭 규칙 하나(seq)의 이름·조건·연결 기초상품·순서(priority)를 고칠 때') and enumerates exactly which fields are mutable, including reordering. It names the sibling tools it is not (create_item_mapping_rule, delete_item_mapping_rule), so an agent can route correctly 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?

Explicit 'When to use' and 'When NOT to use' blocks name the alternatives and their conditions, plus the important exclusion that no bulk-overwrite path exists and rules must be updated one at a time. It also gives prerequisites/sequencing guidance: create_restore_point before writing if a rollback baseline is needed, and refresh_cogs_relation after all edits to propagate to derived tables.

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