Skip to main content
Glama

company_product_margin

Build a per-SKU product margin report from orders, stock, settlements, and catalog. Shows revenue, costs, fees, contribution, break-even units, and revenue-to-contribution waterfall for any window.

Instructions

Build the sealed product margin report: per-SKU units, discounts, returns, net revenue, landed cost of goods, fees at the settlement batches' observed rate, fulfilment and return handling, contribution, break-even units, and the revenue-to-contribution waterfall from the persisted orders, stock positions, settlement batches, and published catalog (payload: optional window_start, window_end; the window defaults to the thirty days to now).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nowNo
engineNo
operationNobuild
entity_refNo
project_idYes
bundle_jsonYes
payload_jsonNo{}

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.2

TDQS

C2.7/5.0
Behavior2/5

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

With no annotations, the description carries full responsibility for behavioral disclosure. It states the tool 'Builds' a report from various data sources, implying a computation, but it does not disclose whether this mutates data, whether it is a read-only operation, or any side effects. The term 'sealed' hints at immutability, but this is not made explicit. No details on auth requirements, rate limits, or data freshness are provided.

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 description is a single dense sentence that front-loads the primary purpose before enumerating metrics and data sources. Every element is relevant to what the tool does. However, the structure is a run-on and could be more readable with separation of purpose, inputs, and defaults. Still, it is appropriately sized for the amount of detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values are covered elsewhere. However, the description does not fully explain required inputs (project_id, bundle_json) or the meaning of 'sealed'. It also doesn't mention any prerequisites or error conditions. Given the tool's complexity and the lack of annotations, the description is incomplete for safe invocation.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It does explain the payload's optional window_start and window_end and their default behavior, which clarifies one parameter. However, it does not explain the required project_id or bundle_json, nor the other optional parameters (now, engine, operation, entity_ref). This leaves a substantial semantic gap for the agent.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb and resource: 'Build the sealed product margin report.' It enumerates the report's contents in detail (per-SKU units, discounts, returns, net revenue, landed cost, fees, contribution, break-even units, waterfall). It does not explicitly distinguish from sibling margin tools like company_services_margin or commerce_margin_analysis, but the word 'product' provides some differentiation. This is above baseline but not maximally clear against the sibling set.

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

Usage Guidelines2/5

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

The description gives a default window ('the thirty days to now') and mentions optional window_start/window_end, which is useful context. However, it provides no guidance on when to choose this tool over alternatives such as company_services_margin or commerce_margin_analysis mirroring its purpose. There are no exclusions or explicit alternative references, leaving the agent to infer when this is the correct tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools