Skip to main content
Glama

Marginrule pricing agent

What a discount does to fees and profit

discount_impact
Read-onlyIdempotent

Effect of a percentage or fixed-dollar discount (a sale or promo code) on one item: discounted price, fees and profit at list and at the discounted price, the profit lost per sale, and how many discounted sales it takes to earn the same profit as 100 sales at list. With an optional target_margin it also returns the deepest discount that still keeps that margin after fees. Rates and margins are FRACTIONS (0.25 = 25% off). US sellers only. Read-only; sells nothing.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "platform": "<platform>",
      "list_price": "<list_price>"
    },
    "name": "discount_impact"
  }
}

Input Schema

NameRequiredDescriptionDefault
costNoOptional cost per item in USD, so profit and margin are included. Default 0.
regionNoBuyer location relative to a US seller. "us" (default) = domestic. "international" is only modelled with processor "paypal" (adds PayPal's 1.50% international fee, so 4.99% + $0.49); other combinations return an error rather than a guess.
platformYesPlatform and plan id from list_platforms, e.g. "etsy", "payhip-free", "gumroad-direct", "ko-fi-shop".
processorNoCard processor for platforms where the seller adds their own (Payhip plans, Ko-fi Shop). "stripe" = 2.9% + $0.30 (default). "paypal" = PayPal Checkout or Guest Checkout, 3.49% + $0.49. Ignored, with a note, for platforms that charge their own processing (Etsy, Shopify, Gumroad, Notion, Square).
list_priceYesRegular price in USD before the discount and before buyer sales tax, in whole cents, e.g. 20.
discount_usdNoFixed dollars off per item, in whole cents, e.g. 5. Send this OR discount_rate, not both.
discount_rateNoPercentage off as a FRACTION: 0.25 means 25% off, used to 6 decimals. Send this OR discount_usd, not both. The dollar amount off is rounded to the cent, half away from zero.
target_marginNoOptional target profit margin as a FRACTION (0.30 = 30%). If sent, the answer also gives the deepest discount off list_price that still keeps it, and whether this discount keeps it.
buyer_tax_rateNoBuyer's sales tax as a FRACTION, e.g. 0.07 for 7%. Default 0. Tax is never profit; it only raises card processing on platforms that charge processing on the tax-inclusive total (see each platform's tax_base).
processor_rateNoAdvanced override: your own card processor percentage as a FRACTION (0.029 = 2.9%). Only for platforms where the seller adds their own processor. Replaces the preset's rate.
processor_fixed_usdNoAdvanced override: your card processor's fixed fee per sale in USD, e.g. 0.30. Replaces the preset's fixed fee.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so "Read-only; sells nothing" adds no new information. Beyond that, the description discloses the result set the agent will get back and the US-only market constraint, which matters for interpreting output; it stops short of describing error behavior or edge cases in the description text itself.

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?

Front-loaded with the core computation and then the returned figures, with the optional margin behavior and the fraction convention surfaced before the scope caveat. It is a single dense sentence chain, but nearly every clause carries a distinct fact; only the read-only restatement is redundant against annotations.

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?

With no output schema, the description correctly shoulders the burden of explaining return values and does so item by item, plus the conditional extra result when target_margin is supplied. For an 11-parameter tool the remaining gaps (invalid-discount handling, behavior when discount exceeds price) are minor given the schema's constraints and exclusivity notes.

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 every parameter including the discount_rate/discount_usd exclusivity and target_margin is already documented. The description's only added emphasis is that rates and margins are fractions (0.25 = 25% off), which reinforces rather than extends the schema. Baseline 3 is appropriate.

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?

Names a specific computation ("effect of a percentage or fixed-dollar discount... on one item") and enumerates the exact outputs: discounted price, fees and profit at list and at discount, profit lost per sale, and break-even sales volume. This is clearly distinguishable from a plain fees_breakdown or price_for_margin calculation.

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?

Usage is implied by the description of what it computes, and hard scope limits are stated ("US sellers only", no selling). But no sibling is named, so the agent must infer for itself when to use this instead of price_for_margin — especially since the optional target_margin path overlaps with that tool's apparent purpose.

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