Skip to main content
Glama

Update base products

update_base_products
Destructive

Update Items

When to use: 이미 등록된 기초상품의 원가 이력을 고치거나, 브랜드·상품코드·상품명을 바꿀 때.

When NOT to use: 새 기초상품 등록은 create_base_products. replace 모드로 기존 이력을 읽지 않고 바꿀 행 하나만 보내면 나머지 원가 이력이 지워지므로 그렇게 호출하지 않는다(바꿀 행만 보낼 때는 merge). 옵션↔기초상품 연결만 고치는 것은 update_item_relation. 엑셀로 받은 원가를 한꺼번에 반영하는 것은 웹의 파일 업로드 흐름이다.

Limitations: body 는 고칠 기초상품 항목의 리스트다. item_brand_name·item_id·item_name 으로 대상을 고르고(list_base_products 결과 값을 그대로 복사한다), 바꿀 값만 new_item_brand_name·new_item_id·new_item_name 에 넣는다(비우면 원래 값 유지). 원가를 추가하거나 바꾸기만 할 때는 cogs_history_mode='merge' 로 바꿀 행만 보낸다: 저장된 이력은 그대로 두고 같은 적용시각 행만 덮어쓴다. 대상 원가가 하나도 없으면 404 (problem type item--not-found, 새 등록은 create_base_products). cogs_history_mode='replace'(기본)는 원가 이력을 통째로 덮어쓴다: 대상(브랜드·상품코드·상품명이 모두 같은 원가 행)을 provider 와 상관없이 전부 지우고 body 의 cogs_history 로 다시 넣는다. 빠뜨린 적용시각의 원가는 지워지므로, 이력의 행을 지우려는 것이 아니면 merge 를 쓴다. replace 로 쓸 때는 먼저 list_base_products(brand_name·item_id·item_name 을 함께 줘 그 SKU 하나만 정확 일치로)로 기존 이력을 읽어 provider 까지 그대로 넣고 바꿀 행만 고친다. provider 를 생략한 행은 MANUAL 로 저장된다. 새로 넣거나 바꾸는 행의 원가가 음수이면 422 (problem type item--cogs-history-row-rejected, rows 에 그 행). 같은 적용시각을 두 번 넣으면 422. 적용시각의 시간대 표기는 무시되고 적힌 날짜·시각이 그대로 저장된다. MANUAL 이 아닌 원천 원가는 다음 원가 최신화가 원천 값으로 다시 채운다. 같은 브랜드·상품코드의 다른 상품명 행은 건드리지 않는다. cogs_history 가 비면 400. SKU 변경은 매칭을 연쇄 갱신한다: new_* 중 하나라도 원래 값과 다르면 그 기초상품에 연결된 상품 매칭(item_relation)·솔루션/통합 매칭·라벨 연결을 새 값으로 함께 옮기고(브랜드·상품코드 변경이면 MANUAL 판매가와 함께 옮길 이름 변형도), 상품 매칭 행이 바뀌면 item_relation 스코프 이력에 trigger=sku_cascade 로 따로 남긴다. 사방넷·굿엠디·이지어드민의 브랜드 보존 행은 body 의 cogs_history 에 든 솔루션 것만 새 값으로 다시 쓰이고, 브랜드·상품코드를 바꿀 때 cogs_history 가 저장된 보존 솔루션을 하나라도 빼면 422 이므로 저장된 솔루션을 모두 넣는다. 이 도구는 복원 지점을 만들지 않으므로, 신원을 바꾸기 전에는 호출자가 create_restore_point 로 entity_type=item_relation 복원 지점도 직접 먼저 만든다. 새 item_brand_name+item_id 가 이미 있으면 409. 원천이 원가를 대는 기초상품의 상품코드 변경, 원천이 브랜드를 보존하지 못하는 기초상품(구글 시트·INGESTION 등)의 브랜드 변경은 422 (problem type item--identity-owned-by-source) 이고, 원가가 모두 MANUAL 이어도 옛 브랜드+상품코드에 MANUAL 이 아닌 판매가(예: 구글 시트 「판매가 히스토리」 탭)가 있으면 422 이니 원천을 먼저 고친다. 새 키의 판매가·라벨과 겹쳐도 422. 상품명만 바꾸는 것은 원천 기초상품도 되지만 행마다 provider 를 그대로 넣어야 하며, 생략하면 원천 행이 MANUAL 로 저장된다. 원가 변경은 cogs+'-' 스코프 데이터관리 이력에 남는다. 다음 배치 주기에 변경 뒤 상태가 복원 지점으로 찍히지만, 쓰기 직전 상태는 따로 찍히지 않는다. 그래서 되돌릴 기준점이 필요하면 쓰기 전에 create_restore_point(entity_type=cogs, entity_id='-')로 먼저 복원 지점을 만든다. 되돌리기 자체는 MCP 도구로 열려 있지 않다(라플라스 웹 데이터 관리 화면의 「버전 히스토리」에서 한다). 라플라스 웹 「기초 상품 관리」의 엑셀 파일 업로드(파일을 올린 뒤 반영하는 흐름으로, MCP 도구로 열려 있지 않다)와 다른, 행을 JSON 으로 직접 쓰는 도구다. 업로드해 둔 대기분을 반영하지 않는다. 요청 하나가 한 트랜잭션이라 항목 하나라도 거부되면 아무것도 저장되지 않는다. 저장 뒤 대시보드의 원가·이익 수치는 데이터 마트 갱신으로 비동기 반영된다. data_management:write 권한 + BASE_PRODUCT 스코프 필요.

Examples:

  • Q: '브랜드A' 수분크림 50ml 원가를 11월부터 4,800원으로 바꿔줘 params: {'body': [{'item_brand_name': '브랜드A', 'item_id': 'SKU-1', 'item_name': '수분크림 50ml', 'cogs_history_mode': 'merge', 'cogs_history': [{'apply_start_datetime_id': '2026-11-01T00:00:00', 'cogs': 4800}]}]}

  • Q: '브랜드A' 수분크림 50ml 의 상품코드를 A-100 으로 바꿔줘 params: {'body': [{'item_brand_name': '브랜드A', 'item_id': 'SKU-1', 'item_name': '수분크림 50ml', 'new_item_id': 'A-100', 'cogs_history': [{'apply_start_datetime_id': '2026-01-01T00:00:00', 'cogs': 4500, 'provider': 'MANUAL'}]}]}

Related resources: analytics://glossary/cogs

Output shape: null — 성공 시 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_base_products"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyYes
project-idNo
auth_methodNojwt

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 already flag destructiveHint=true, and the description goes far beyond that: replace mode deletes all matching cogs rows regardless of provider, merge only overwrites the same apply timestamp, 404/422/409/400 failure modes with problem types, SKU changes cascade to item_relation and label links with trigger=sku_cascade, and the whole request is one transaction so one rejected row saves nothing. It also discloses permission requirements (data_management:write + BASE_PRODUCT scope), that no restore point is created automatically, and that dashboards refresh asynchronously.

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 when-to-use / when-NOT-to-use / Limitations structure is front-loaded and the examples map directly to the two main modes. However, the Limitations block is a dense run-on paragraph that repeats create_restore_point guidance twice and re-mentions create_base_products several times, which costs some scannability for an otherwise high-value text.

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, nested-body mutation with no output schema, the description covers everything an agent needs: target selection, mode semantics, cascade effects, error codes, permissions, transaction atomicity, and the fact that success returns no body. Nothing material is left for the agent to guess.

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%, so the description carries the full burden, and it does: item_brand_name/item_id/item_name identify the target (copied verbatim from list_base_products), new_* fields are optional overrides that are left unchanged when omitted, cogs_history_mode defaults to replace with divergent semantics, omitted provider defaults to MANUAL, and the timezone notation in apply_start_datetime_id is ignored. This is meaning well beyond the bare JSON schema titles.

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 opening line ('Update Items') is thin, but the 'When to use' clause immediately specifies the resource and the three editable dimensions: existing cogs history, brand, item code, and item name of an already-registered base product. It also names what it is not (create_base_products for new registration, update_item_relation for option-to-product links), so an agent can distinguish it from siblings without opening 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, with named alternatives for each excluded case (create_base_products, update_item_relation, the web Excel upload flow) and an explicit warning not to call replace mode with only the rows to change. The merge-vs-replace decision rule is stated as a rule, not left to inference.

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