Skip to main content
Glama

Item Cost of Goods

get_item_cogs
Read-onlyIdempotent

Get the current cost of goods sold and full cost history for one item, identified by sku, product_id (internal product id), or variant_id (the commerce platform's variant id, e.g. the Shopify variant id - not an internal uuid). Optional on_date returns the cost effective on that date.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
skuNoThe item's SKU. Provide at least one of sku, product_id, or variant_id.
on_dateNoReturn the cost effective on this date, in YYYY-MM-DD format, resolved in the tenant's timezone (default: today).
product_idNoThe internal MerchantFlow product id (Product.id), not the commerce platform's own product id. Provide at least one of sku, product_id, or variant_id.
variant_idNoThe commerce platform's own variant id (e.g. the Shopify variant id), not the internal ProductVariant.id. Provide at least one of sku, product_id, or variant_id.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNo
_metaNo
as_ofNo
currentNoThe cost effective on the requested date, or null when the item has none.
historyNoEvery cost record for the item, newest first.
_messageNo
_truncatedNo
_tenant_contextNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already establish the tool is read-only and idempotent. The description adds useful behavioral detail beyond that: it returns both current COGS and full cost history, and on_date changes the effective valuation date. This is meaningful context without contradicting the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with the primary action and scope front-loaded, followed by the identifier options and optional date behavior. Every sentence earns its place and there is no filler or redundant explanation.

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 read-only single-item lookup with a rich input schema, detailed annotations, and an output schema, the description covers what the tool does, how to identify the item, and the optional historical-date behavior. No additional context is needed for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all four parameters in detail. The description mostly restates the schema's identifier guidance and adds only a small clarification about variant_id being the commerce platform's id, which is already present in the schema. It therefore adds little beyond the structured data.

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 'Get the current cost of goods sold and full cost history for one item,' which names a specific verb, resource, and scope. It further clarifies the three accepted identifiers, making it easy to distinguish from siblings like list_cogs or get_cogs_coverage.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly scopes the tool to a single item and explains the optional on_date behavior, which gives strong contextual guidance. It does not explicitly name sibling alternatives or state when not to use it, but the 'for one item' phrasing implies the boundary versus list-style tools.

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