Skip to main content
Glama
profit-lens

profit-lens

Find profit leaks

find_profit_leaks
Read-onlyIdempotent

Detect unprofitable SKUs, refund outliers, channel overspend, discount leaks, stockout risk, and dead stock, then rank findings by estimated monthly profit impact with evidence and fixes.

Instructions

Runs every leak detector (unprofitable SKUs, refund-rate outliers, channels whose extra spend returns below breakeven, leaked discount codes, stockout risk, dead stock) and returns the findings ranked by estimated monthly profit impact, each with evidence, a plain-English explanation and a suggested action.

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": "find_profit_leaks"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoEnd date (inclusive, YYYY-MM-DD). Requires `from`.
daysNoTrailing window in days, ending on the data as-of date. Ignored when from/to are given.
fromNoStart date (inclusive, YYYY-MM-DD). Requires `to`.
limitNo
typesNoOnly run these detectors.
minMonthlyImpactNoHide leaks smaller than this (USD per month).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world, so the safety profile is covered. The description adds genuine context beyond that: it discloses that all detectors execute, that output is ranked by estimated monthly profit impact, and that each finding carries evidence, a plain-English explanation, and a suggested action. It omits runtime/cost of running all detectors and rough result volume, which would have pushed this higher.

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?

A single sentence with the action front-loaded and no filler. The six-detector parenthetical is dense but each item earns its place by telling the agent what categories will appear in the results. Minor cost: one long sentence rather than a short purpose line plus a detail line.

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

Completeness4/5

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

There is no output schema, so the description must describe returns, and it does: ranked findings with evidence, explanation, and suggested action. Combined with annotations covering safety, an agent can call this correctly with no required parameters. Gaps are modest: `limit` behavior and expected result volume are not addressed.

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 83%, so the schema already carries most parameter meaning (from/to pairing, days window, minMonthlyImpact in USD). The description's detector list in plain English loosely maps to the `types` enum, adding a little interpretive value, but it says nothing about `limit` or the from/to-vs-days precedence beyond what the schema states. Baseline 3 is appropriate.

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?

States a specific verb ('Runs every leak detector') and enumerates the six detector categories plus the ranking basis (estimated monthly profit impact) and payload (evidence, explanation, suggested action). That is far more precise than a bare 'find leaks'. It stops short of naming how it differs from narrower siblings such as get_sku_margins or get_channel_pnl, leaving the breadth-vs-depth distinction to inference.

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

Usage Guidelines3/5

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

No explicit when-to-use, when-not-to-use, or alternative routing is stated. Usage is only implied: 'runs every leak detector' signals a comprehensive scan, and the `types` parameter signals you can narrow it, but an agent gets no instruction on when to prefer a single-metric sibling or how expensive a full scan is.

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