Skip to main content
Glama

Get product costs (COGS)

get_cogs
Read-only

Get 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

NameRequiredDescriptionDefault
sortNoSort direction (asc/desc)desc
limitNoPage size (1-10000). When sent, the response adds total, has_more and next_offset; when omitted, every row is returned.
offsetNoRows to skip before the page. Applied only together with limit; ignored without it.
item_idNoItem ID search keyword
order_byNoColumn to order byitem_name
item_nameNoItem name search keyword
project-idNo
brand_namesNoComma-separated brand names to filter

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description adds real operational context beyond that: latest-snapshot-only semantics, fixed tie-break ordering (brand_name, item_id, seq), the has_more/next_offset continuation loop, and a warning that omitting limit returns all rows (multi-MB on large tenants). The one gap is that `project-id` behavior and any permission/tenant scoping are never mentioned.

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?

Structure is strong and front-loaded: purpose, when-to-use, limitations, two concrete examples, related glossary resources, then output shape. Some pagination detail is restated in both 'Limitations' and 'Output shape' (has_more/next_offset appears twice), which is the only waste in an otherwise efficient definition.

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-parameter, zero-required read tool with an output schema present, the description covers filtering, sorting, tie-break stability, paging loop, and the response envelope, plus example invocations. Nothing an agent needs in order to call it correctly is missing, even though return-value explanation was not strictly required.

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?

Schema coverage is 88%, so the baseline is 3, but the description adds meaning the schema does not: brand_names is a comma-separated string, item_id/item_name are partial-match (the schema only says 'search keyword'), sort accepts asc|desc with order_by defaulting to item_name, and offset applies only when limit is present. Only `project-id`, which has no schema description either, goes 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 ('Get Cogs Data', '상품별 매출원가(COGS) 단가와 변경 이력 건수를 조회') with scope (latest snapshot only, brand/item filters, sorted rows). It also explicitly distinguishes itself from the sibling `list_base_products`, which holds per-application-date cost rows, so an agent can choose correctly without opening either 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?

There is an explicit 'When to use' clause tying the tool to margin analysis / gross_margin prerequisite data, plus a 'Limitations' clause naming the alternative path for historical cost tracking (`list_base_products`). Exclusions and alternatives are both stated rather than inferred.

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