Skip to main content
Glama

Update product option matches

update_item_relation
Destructive

Update Item Relation

When to use: 옵션(채널 상품)↔기초상품 연결을 직접 고쳐 저장할 때. 자동 매칭이 놓친 건을 수동 연결하거나 잘못 연결된 기초상품을 바로잡는 용도.

When NOT to use: 연결을 끊는 것은 delete_item_relations. 엑셀 업로드로 대량 반영하려면 upsert_item_relation_from_tmp(웹에서 올린 파일을 반영하는 단계). 현재 매칭 현황 조회는 search_item_relations 또는 get_item_mapping_counts.

Limitations: body 는 ItemRelationSchema 리스트다 — 옵션 식별 필드(brand_name·channel_name·product_id·option_id·product_name·option_name)에 더해 연결할 기초상품을 mapped_items 중첩 리스트로 넘긴다(평면 item_id/item_qty 필드가 아니다). 각 항목은 item_brand_name·item_name·item_id·item_qty(0 이상)이고 is_gift 는 선택이다. 옵션 단위 overwrite — 위 6개 식별 필드가 모두 일치하는 기존 행을 지우고 body 내용으로 다시 넣는다. product_name·option_name 까지 키에 포함되므로 search_item_relations 결과를 그대로 복사해 넘겨야 한다 — 이름 한 글자만 달라도 기존 행이 남고 중복이 생긴다. mapped_items 를 빈 리스트로 주면 그 옵션의 연결이 해제된다. body 가 빈 리스트면 400. data_management:write 권한 + ITEM_MAPPING 스코프 필요. item_relation 스코프 감사 이벤트로 기록되므로 복원 가능하다.

Examples:

  • Q: 이 옵션을 기초상품 '수분크림 50ml' 에 연결해줘 params: {'body': [{'brand_name': '브랜드A', 'channel_name': '스마트스토어', 'product_id': '1001', 'option_id': '1', 'product_name': '수분크림', 'option_name': '50ml 단품', 'mapped_items': [{'item_brand_name': '브랜드A', 'item_name': '수분크림 50ml', 'item_id': 'SKU-1', 'item_qty': 1}]}]}

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": {
      "body": "<body>"
    },
    "name": "update_item_relation"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyYes
project-idNo
auth_methodNojwt

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 already flag destructiveHint=true, but the description goes far beyond: it discloses per-option overwrite semantics (rows matching all six identifier fields are deleted then re-inserted), that a one-character name mismatch leaves a stale row and creates duplicates, that an empty mapped_items array unlinks, that an empty body returns 400, required data_management:write permission plus ITEM_MAPPING scope, and that an audit event makes changes restorable. That is exactly the context annotations cannot carry.

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?

Section headers (When to use / When NOT to use / Limitations / Examples / Output shape) make it scannable and the worked example resolves ambiguity about the nested shape. It is long but dense with non-redundant information; the only waste is the restated 'Update Item Relation' heading before the substantive guidance.

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 destructive, single-parameter-payload mutation with no output schema, the definition supplies permissions, overwrite behavior, error case, unlink semantics, audit/restorability, and a full example body. The absence of an output schema is explicitly compensated by 'Output shape: no content (성공 시 body 없음)', leaving only minor framework parameters unexplained.

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 the description has to carry the load, and it does for the critical parameter: body is a list of ItemRelationSchema with a nested mapped_items array rather than flat item_id/item_qty fields, each mapped item requires item_brand_name/item_name/item_id/item_qty (>=0) with optional is_gift, and the six fields that form the overwrite key are enumerated. Gaps remain for the top-level project-id and auth_method parameters and the relation_provider/relation_provider_type fields, which are never mentioned.

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 heading 'Update Item Relation' is thin on its own, but the 'When to use' line immediately states a specific verb and resource: 직접 고쳐 저장 (directly fix and save) of option(channel product)↔base product links. It also distinguishes the intent (manual re-linking, correcting wrong matches) from lookup and bulk-import siblings, so an agent can identify the tool without opening the 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-NOT-to-use section names three alternatives with the exact condition selecting each: delete_item_relations for unlinking, upsert_item_relation_from_tmp for Excel bulk uploads, and search_item_relations / get_item_mapping_counts for viewing current state. This is textbook routing guidance with both inclusion and exclusion criteria.

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