Skip to main content
Glama

Marginrule pricing agent

Lowest price for a target margin

price_for_margin
Read-onlyIdempotent

Lowest whole-cent price that keeps a target profit margin on a selling platform after its fees, for a given cost per item. status is "ok", "not_possible" or "not_practical". With "ok" it returns price_usd, the fee breakdown at that price, profit_usd and the achieved margin. target_margin is a FRACTION of the price (0.30 = 30%). Rates are dated and sourced; read 'assumptions' and 'verify' before quoting. 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>",
      "cost": "<cost>",
      "target_margin": "<target_margin>"
    },
    "name": "price_for_margin"
  }
}

Input Schema

NameRequiredDescriptionDefault
costYesYour cost per item sold in USD (materials, labour, packaging you pay). 0 for a digital download with no per-sale cost.
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).
target_marginYesTarget profit margin as a FRACTION of the price: profit / price. 0.30 means 30%. Must be at least 0 and under 1. A value like 30 is rejected as a percent. Margins below 0.0001 are treated as 0. Within 0.01 of the platform's maximum (1 minus its percentage fees) the answer is status "not_practical".
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.
price_floor_usdNoLowest price to suggest, in USD. Default 1.00 (Marginrule's assumption, not a platform rule). 0 turns the floor off.
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

A4.4/5.0
Behavior5/5

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

Annotations already cover safety (read-only, idempotent, non-destructive), yet the description still adds substantive behavior: the three status values, what the 'ok' payload contains, the US-only scope restriction, and the warning that dated sourced rates require checking assumptions/verify before quoting. That is well beyond repeating the annotation profile.

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?

Purpose is front-loaded, then status semantics, then parameter caveat, then sourcing warning — a sensible ordering with no filler. The parenthetical '0.30 = 30%' duplicates the schema wording almost verbatim, a small redundancy in an otherwise dense, efficient paragraph.

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

Completeness5/5

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

With nine parameters and no output schema, the description carries the burden of describing returns, and it does: status values plus price_usd, fee breakdown, profit_usd and achieved margin. Platform scope and the dating/sourcing caveat round out what an agent needs to interpret the result correctly.

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 coverage is 100% and the schema descriptions are already detailed (fractions, floors, processor overrides, regional restriction). The description restates the fraction convention for target_margin and the cost-per-item framing, which is helpful emphasis but adds little new meaning beyond the schema.

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?

The opening sentence names a precise verb+resource: the lowest whole-cent price that preserves a target margin after platform fees for a given unit cost. That is clearly distinct from siblings like fees_breakdown or discount_impact, and the status vocabulary reinforces the exact computation being performed.

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

Usage Guidelines4/5

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

It gives real usage conditions: US sellers only, read 'assumptions' and 'verify' before quoting, and target_margin is a fraction. It also implies when the answer is unusable via the not_possible/not_practical statuses. It stops short of explicitly routing to siblings or stating when a different tool should be used instead.

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