Margin Scoring
ps_margin_scoringCalculate gross margin per product using price and wholesale price, classify margins as excellent, good, low, or critical, mark missing cost data as no_data, and save results to a dated JSON file.
Instructions
Calculate gross margin per product using the wholesale_price field.
margin % = (price - wholesale_price) / price × 100 Classification: "excellent" (>50%), "good" (30–50%), "low" (15–30%), "critical" (<15%) Products without wholesale_price are marked as "no_data".
Saves to /data/margin_scores_YYYY-MM-DD.json.
Args:
lang_id: Language ID for product names (default: "1")
limit: Max products to analyse (default: 200)
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": "ps_margin_scoring"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max products to analyse | |
| lang_id | No | Language ID for product names | 1 |