Worked MCP examples
These examples show how a capable assistant should turn a business question into a focused DataGlass investigation. Each walkthrough starts with the user's words, resolves the required scope, calls only the tools needed for evidence, and ends with an answer designed for a decision.
How to read a walkthrough
Each example has five parts:
- When to use it defines the decision and the correct comparison.
- Prompt is ready to copy and adapt.
- Tool route shows the smallest useful sequence and why each call exists.
- Illustrative answer demonstrates the expected hierarchy, caveats, and next step.
- Quality checks help you judge whether the assistant answered reliably.
Tools expose exact input schemas to the connected assistant at runtime. The route tables below emphasize business intent; shop IDs and regions must always come from the discovery result, not from the examples.
1. Run a 30-day shop health check
When to use it
Use this at the start of a weekly review or when you want to know whether a shop needs attention before choosing a deeper analysis. Compare the selected 30 days with the immediately preceding 30 days so seasonal timing is clear and the windows have equal length.
Prompt
Give Bangkok Home Studio on Shopee a health check for the last 30 days,
compared with the immediately preceding 30 days. Start with one sentence,
show realized profit, GMV, margin, COGS coverage, and loss-makers, then rank
the three most important risks. State the exact dates and THB currency. Label
any result that uses inferred COGS.
Tool route
| Step | Tool | Why it is called | Stop or continue? |
|---|---|---|---|
| 1 | list_shopee_shops | Resolve the authorized shopId, region, shop name, and timezone. | Stop with a clear explanation if the shop is not returned. |
| 2 | diagnose_shop | Retrieve the compact headline, KPI deltas, COGS coverage, loss-makers, and drilldown signals with a 30-day lookback. | Usually enough for the first answer. |
| 3 | Signal's suggestedTool | Verify one material warning, such as a product or ads driver. | Call only when the signal changes the conclusion or the user requested evidence. |
The assistant should not call every financial and product endpoint after diagnose_shop. A compact health question is complete once the headline and top risks are supported.
Illustrative answer
Bangkok Home Studio needs attention: realized profit fell 8.4% to ฿136,420 from 17 June–16 July, while GMV was nearly flat at ฿928,600 (+0.7%).
- Margin compression — warning. Weighted margin fell from 16.8% to 14.7% (−2.1 percentage points). Two lower-margin products accounted for 71% of the profit decline.
- Loss-makers — warning. Six products lost ฿9,840 combined. The largest loss-maker contributed ฿5,120 of that amount.
- COGS confidence — review. Explicit COGS covers 82% of GMV; the remaining 18% uses inferred cost, so product-level profit in that portion is directional.
Order volume was stable, so the strongest current explanation is product mix rather than demand. Review the two negative product contributors first. No shop data was changed.
Quality checks
- The conclusion appears before the detail and uses realized profit, not payout.
- Current and comparison windows are equal and explicit.
- Changes show both direction and magnitude; margin uses percentage points.
- Inferred COGS is labeled instead of presented as exact.
- The assistant follows no more than the material signals required for the answer.
2. Explain why profit dropped
When to use it
Use this when profit, sales, or margin moved unexpectedly and you need ranked causes rather than another dashboard summary. This walkthrough uses Lazada to show that the same unified diagnosis can route into platform-specific financial and product evidence.
Prompt
Why did realized profit drop for Northstar Living on Lazada this month to
date versus the same number of days immediately before it? Rank the drivers
by profit impact. Separate product mix, fees, ads, missing COGS, and unsettled
orders. Show only the product rows needed to support the conclusion.
Tool route
| Step | Tool | Evidence produced |
|---|---|---|
| 1 | list_lazada_shops | Authorized sellerId and region for Northstar Living. |
| 2 | diagnose_shop | Direction of profit, GMV, margin, orders, COGS coverage, and ranked signals. |
| 3 | get_lazada_financial_overview | Platform P&L totals, cost movement, loss-makers, and the comparison period. |
| 4 | rank_lazada_products_by_profit | Products with the greatest positive and negative total-profit contribution. |
| 5 | get_lazada_product_breakdowns | Detail for only the leading negative contributors. |
If diagnose_shop shows stable product economics but a settlement-timing warning, the assistant can stop before requesting product rows and explain why the newest period is incomplete.
Illustrative answer
Realized profit fell ฿24,140 (−13.6%) month to date. The decline is real, although approximately ฿1,600 may still settle from recent orders.
Rank Driver Estimated profit impact Evidence 1 Lower-margin product mix −฿12,480 Two promoted items grew to 29% of GMV but carried 7–9% margin. 2 Higher ads cost −฿7,120 Spend rose 18% while attributed realized profit did not grow. 3 Commission and service fees −฿2,940 Effective fee share increased 0.6 percentage points. 4 Other product movement −฿1,600 Remaining products had small mixed changes. COGS coverage stayed at 94%, so missing cost is not the primary explanation. Start with the two promoted products; together they explain more of the decline than the fee increase.
Quality checks
- The causes reconcile approximately to the total change and are ordered by impact.
- The answer distinguishes settled evidence from incomplete recent activity.
- COGS is checked before calling the decline conclusive.
- Only the leading product rows are shown; a full catalog dump is avoided.
- The assistant does not mistake stable GMV for stable profit.
3. Find ads that look healthy but lose money
When to use it
Use this when marketplace-reported ROAS looks strong but profit is weak, or before reallocating campaign budget. Shopee and TikTok Shop have curated ads tools; Lazada campaign analysis is not currently part of the curated MCP surface.
Prompt
Review Shopee ads for Bangkok Home Studio over the last 30 days. Rank active
campaigns by weakest True ROAS, compare True ROAS with marketplace ROAS and
the profit-aware floor, then classify each material campaign as reduce, hold,
or consider scaling. Explain the evidence and do not apply any change.
Tool route
| Step | Tool | Evidence produced |
|---|---|---|
| 1 | list_shopee_shops | Authorized shop and region. |
| 2 | get_shopee_ads_performance | Active campaigns, spend, attributed GMV, orders, and headline ROAS. |
| 3 | get_shopee_corrected_roas | Cancellation- and return-adjusted performance for suspect campaigns. |
| 4 | get_shopee_campaign_profit_adjusted_roas | Stored profit-aware ROAS floor used to judge break-even. |
| 5 | get_shopee_target_roas_recommendations | Proposed targets for relevant campaigns, when available. |
For TikTok Shop, use get_tiktok_gmv_max_campaigns, drill into get_tiktok_gmv_max_sessions only when product-level detail is needed, confirm with get_tiktok_campaign_roas, and then read budget or target-ROAS recommendations.
Illustrative answer
One of four material campaigns is below its profit-aware floor. Marketplace ROAS alone makes it look healthy.
Campaign Marketplace ROAS True ROAS Profit-aware floor Decision Storage Set Auto 5.2× 2.1× 2.8× Reduce / review Linen Search 4.1× 3.4× 2.9× Hold Kitchen Bundle 3.8× 3.6× 2.7× Consider scaling carefully Brand Terms 6.4× 5.9× 3.1× Hold; limited volume Storage Set Auto lost efficiency after cancellations, returns, fees, and COGS were included. DataGlass proposes a 3.0× target ROAS. Nothing has changed yet. Say the word and I can apply it with
apply_shopee_target_roas— that raises the floor on live spend immediately, andrevert_shopee_target_roasundoes it. Otherwise, review it in DataGlass.
Quality checks
- True or profit-adjusted ROAS drives the decision—not headline ROAS alone.
- The relevant date range and active-campaign filter are explicit.
- Spend volume is considered before scaling a high-ROAS campaign.
- A recommendation is described as proposed until a write tool has actually run.
- Any offer to apply names the tool, the live effect, and how to revert — and waits for a go-ahead.
- The answer separates “reduce,” “hold,” and “consider scaling” with reasons.
4. Repair a low-margin product with a simulation
When to use it
Use this when a product sells but contributes too little profit, or when you want to compare price, discount, or COGS options before acting. This example uses TikTok Shop and preserves every returned product, SKU, campaign, advertiser, and shop identifier as a string.
Prompt
Find the highest-impact low-margin product in Good Day Official on TikTok Shop
for the last 30 days. Verify whether its COGS is entered, inferred, or missing.
Then simulate a 5% price increase while holding discount, fees, COGS, and unit
volume constant. Compare current and simulated profit per unit and margin, list
the assumptions, and do not change the listing.
Tool route
| Step | Tool | Evidence produced |
|---|---|---|
| 1 | list_tiktok_shops | Exact string shopId and region. |
| 2 | get_tiktok_financial_overview | Shop margin, loss-makers, and COGS coverage. |
| 3 | get_tiktok_product_breakdowns | Product-level margin and total-profit impact. |
| 4 | search then fetch | Canonical product and TikTok product/SKU binding when identity needs resolution. |
| 5 | get_product_costs | Explicit, inferred, or missing cost basis. |
| 6 | get_tiktok_product_profit | Current forward unit economics. |
| 7 | simulate_tiktok_profit | One read-only scenario with a 5% price override. |
One simulation should represent one scenario. If the user asks to compare price, discount, and COGS remedies, run three separately labeled simulations rather than combining unrelated overrides into one ambiguous case.
Illustrative answer
Product: Stackable Pantry Box, SKU
PBX-CLEAR-MWhy selected: 1,284 units sold, but only 6.8% margin; its volume makes it the largest thin-margin risk. COGS is explicit, last updated 2 July.
Metric Current Simulated +5% price Change Selling price ฿429.00 ฿450.45 +฿21.45 Profit per unit ฿29.17 ฿48.02 +฿18.85 Margin 6.8% 10.7% +3.9 pp Assumptions: discount rate, marketplace fees, COGS, affiliate/ads allocation, and units sold remain constant. This is a unit-economics what-if, not a demand forecast. The live TikTok Shop listing was not changed.
Quality checks
- Product selection accounts for total impact, not just the lowest percentage margin.
- COGS source and freshness are stated before the recommendation.
- Current and simulated values appear side by side.
- The answer makes fixed assumptions visible and does not imply unit volume will remain unchanged in reality.
- The exact marketplace identifier is preserved as a string internally, while the user sees a useful product name first.
5. Build a restock plan without double ordering
When to use it
Use this in a replenishment review to decide which SKU needs stock, how much to buy, and whether an open purchase order already covers the requirement. Inventory tools are self-scoped across the authenticated user's inventory rather than routed by a marketplace shop ID.
Prompt
Build an urgent restock plan. Start with open inventory alerts, use the (s,S)
reorder quantities and weekly forecast, then subtract quantities from open or
inbound purchase orders. Rank the SKUs by stockout risk. Show current stock,
inbound units, recommended new quantity, and the evidence for each decision.
Do not create a purchase order.
Tool route
| Step | Tool | Evidence produced |
|---|---|---|
| 1 | get_inventory_alerts | Open reorder-point alerts; resolved history is kept separate. |
| 2 | get_reorder_plan | Computed reorder threshold and target quantity by canonical variant. |
| 3 | get_inventory_forecast | Expected weekly or monthly demand over the planning horizon. |
| 4 | get_demand_chart | Historical pattern and forecast context when a recommendation looks unusual. |
| 5 | get_open_purchase_orders | Open and inbound quantities that must be deducted to avoid double ordering. |
Illustrative answer
Three SKUs need action now. One additional alert is already covered by inbound stock and should not create a new order.
Priority SKU On hand Inbound New reorder Evidence 1 ORG-WHT-L 42 0 180 2.1 weeks of cover; 5-week supplier lead time; demand rising 12%. 2 LIN-BGE-Q 18 25 75 Below reorder point after expected 3-week demand. 3 PBX-CLR-M 61 120 40 Plan suggested 160, reduced by 120 confirmed inbound units. — RACK-BLK 35 200 0 Inbound order fully covers the shortage; monitor only. Confirm supplier lead time for ORG-WHT-L first. This connector did not create or modify a purchase order.
Quality checks
- Open alerts are separated from acknowledged, dismissed, or resolved history.
- The recommended quantity is not copied blindly from the reorder plan; inbound units are considered.
- Forecast and lead-time evidence explain urgency.
- The answer includes zero-order decisions when inbound stock is sufficient.
- The assistant states that purchasing remains an external user action.
6. Reconcile a marketplace payout
When to use it
Use this when the amount deposited or shown in a marketplace settlement report differs from expectations. Payout is a cash-settlement question, not a profitability question: always use payout or settlement dates and the platform payout tool.
Prompt
Reconcile Bangkok Home Studio's Shopee payout for 1–15 July. Show the expected
payout, Shopee-reported payout, exact delta, and paid versus pending amounts.
Identify the order or adjustment lines that explain any mismatch. Use payout
dates, display THB, and do not substitute realized profit.
Tool route
| Step | Tool | Evidence produced |
|---|---|---|
| 1 | list_shopee_shops | Authorized shop ID, region, and timezone. |
| 2 | get_shopee_payout | Expected escrow amount, marketplace-reported amount, reconciliation delta, status, and order lines for inclusive payout dates. |
| 3 | get_order | Optional normalized order detail for one material line returned by the payout result. |
For TikTok Shop, get_tiktok_payout compares expected and bank-settlement statements. Lazada's get_lazada_payout returns the net finance-statement settlement split into paid and pending; it does not expose the same expected-versus-reported reconciliation structure.
Illustrative answer
For payout dates 1–15 July, expected payout was ฿84,620.00 and Shopee reported ฿83,336.00, a −฿1,284.00 delta.
- Paid: ฿80,910.00
- Pending: ฿2,426.00
- Explained adjustments: return fee −฿720, shipping adjustment −฿404, commission correction −฿160
- Unexplained remainder: ฿0.00
The three adjustments explain the full difference, so there is no unresolved reconciliation balance. This payout should not be compared directly with realized profit for the same dates because settlement timing and metric definitions differ.
Quality checks
- The answer names the payout or settlement date basis instead of order date.
- Expected, reported, paid, pending, and delta are not conflated.
- Adjustment lines reconcile exactly to the delta; zero means an exact match.
- The response uses local currency and includes decimals where reconciliation precision matters.
- Profit tools are not used as a substitute for settlement evidence.
Adapt these examples
Replace the sample shop, marketplace, product, and period with your decision. Keep the structural instructions that improve answer quality:
- specify the comparison baseline;
- ask for ranked causes or decisions, not a raw export;
- require exact dates, local currency, and COGS confidence;
- ask the assistant to stop after the evidence supports a conclusion;
- describe a recommendation or simulation as a proposal until a write tool has run, and require the assistant to name the tool, the live effect, and the revert path before it offers to act.
For more starting points, use the prompt library. For exact tool inputs and routing constraints, see the MCP tool catalog.