Get product costs (COGS)
get_cogsGet Cogs Data
When to use: 상품별 매출원가(COGS) 단가와 변경 이력 건수를 조회해야 할 때. 마진 분석·gross_margin 계산 전제 데이터로, brand/item 필터 후 정렬해 반환.
Limitations: 현재 시점의 latest COGS 만 반환 — 과거 시점 단가 추적은 이 도구로 할 수 없다(적용 시각별 원가 행은 list_base_products). brand_names 는 콤마 구분 문자열, item_id/item_name 은 부분 일치. 정렬은 'item_name' 기본, sort 는 asc|desc. 동률은 brand_name·item_id·seq 오름차순으로 고정. limit(1~10000)을 보내면 그 페이지만 반환하고 total(필터 후 전체 행 수)·has_more·next_offset 을 함께 준다 — has_more 가 true 면 offset=next_offset 으로 다시 호출해 이어 받는다(마지막 페이지의 next_offset 은 null). limit 을 생략하면 전체 행을 한 번에 반환한다(대형 테넌트는 수 MB). offset 은 limit 과 함께일 때만 적용.
Examples:
Q: '브랜드A' 상품별 원가 보여줘 params: {'query': {'brand_names': '브랜드A', 'order_by': 'item_name', 'sort': 'asc'}}
Q: 상품별 원가를 1000건씩 나눠서 첫 페이지부터 보여줘 params: {'query': {'limit': 1000, 'offset': 0}}
Related resources: analytics://glossary/cogs, analytics://glossary/gross_margin
Output shape: CogsDataPageResponse with rows of (item_id, item_name, brand, latest COGS, history change count), sorted by order_by/sort then brand_name, item_id, seq; total?, has_more?, next_offset? (? = only when limit is sent; next_offset is null on the last page).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_cogs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | Sort direction (asc/desc) | desc |
| limit | No | Page size (1-10000). When sent, the response adds total, has_more and next_offset; when omitted, every row is returned. | |
| offset | No | Rows to skip before the page. Applied only together with limit; ignored without it. | |
| item_id | No | Item ID search keyword | |
| order_by | No | Column to order by | item_name |
| item_name | No | Item name search keyword | |
| project-id | No | ||
| brand_names | No | Comma-separated brand names to filter |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||