Skip to main content
Glama
Order Margin Exposure

Order Margin Exposure

by gptenv

Order Margin Exposure

A stateless MCP service and HTTP report for checking which open customer quotes and orders may be affected by an upcoming supplier cost change. It matches exact SKUs, compares the effective date with each line's expected purchase date, estimates the gross-margin change if the sell price stays fixed, and suggests a quote price that preserves the current gross-margin dollars. It never updates an ERP, changes a quote, or interprets contract terms.

Trial and pricing

  • Free preview: one supplier SKU change and up to two open customer quote/order lines, with no account or external API.

  • Full report: up to 500 supplier changes and 500 commitment lines for 0.04 USDC on Base through x402, via Streamable HTTP MCP or POST /v1/analyze.

  • Optional Stripe Checkout: C$0.50 per report when STRIPE_SECRET_KEY is configured. Checkout binds the payment to a SHA-256 hash of the submitted report data. The same data must be supplied to retrieve the result. No input is retained.

  • Manual options are listed at /payments. Manual transfers are reviewed by a person and are not automatically verified or credited to a report.

The free preview performs deterministic calculations in the Worker. It uses no paid model, database, external data API, or background job. A Stripe charge is attempted only after the customer starts Checkout.

Related MCP server: @margint-ai/mcp

Connect an MCP client

Use the stateless Streamable HTTP endpoint:

{
  "mcpServers": {
    "order-margin-exposure": {
      "url": "https://order-margin-exposure.defcronyke.workers.dev/mcp"
    }
  }
}

Call preview_order_margin_exposure for a small free result. For the full report, call analyze_order_margin_exposure; x402 compatible clients receive a payment challenge for 0.04 USDC on Base.

HTTP API

  • GET /example — synthetic input and free preview plus full sample report

  • POST /v1/preview — free preview; caps input to one supplier change and two commitment rows

  • POST /v1/analyze — full x402 gated report

  • POST /v1/stripe-checkout — create a C$0.50 Stripe Checkout session when configured

  • POST /v1/stripe-result — return a report only after Stripe confirms the same input hash was paid

  • GET /payments — payment information and limitations

  • GET /openapi.json — OpenAPI description

  • GET /.well-known/x402 — payment discovery

  • POST /mcp — Streamable HTTP MCP

The request includes the cost-change SKU rows and commitments with reference, SKU, quantity, current sell price, whether the price is locked, line type, and expected purchase date. Use decimal strings for money, a three-letter currency code, and ISO calendar dates. Rows without an exact supplier SKU match remain unclassified. The service does not infer aliases, taxes, freight, discounts, exchange rates, supplier acceptance, or contract rights. Review the result before acting.

Payment setup

Set PAY_TO to the seller's EVM address before deployment. To activate Stripe, store a SaladFinder Stripe secret as a Worker secret:

npx wrangler secret put STRIPE_SECRET_KEY

Until that secret is configured, Stripe routes return 503 and the payment page says Stripe is inactive. The application never writes the key to source control.

Development

npm ci
npm test
npm run build
npx wrangler deploy

Market context

The workflow is based on recurring supplier-spreadsheet cleanup questions and reports that price changes can leave open quotes and orders using stale costs. See a small-business discussion of messy supplier Excel sheets, a distributor discussion of supplier price-list updates and open orders, and this supplier price-increase workflow guide. Existing procurement and pricing systems also serve this broader category; this tool is a small, input-only report for teams that need a review before changing their systems.

License

MIT. See LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server designed to automate tender and RFQ pricing by extracting requirements from documents and building structured pricing models. It enables users to calculate final costs, compare market rates, and generate styled HTML pricing reports for PDF export.
      -
    • A
      license
      A
      quality
      D
      maintenance
      Enables querying Margint per-customer AI margins and costs from MCP clients. Provides tools to list customers, drill into costs, check budgets, and view workspace-wide cost breakdowns.
      4
      9 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      MCP server that converts hardware specs into Azure price quotes using live Azure Retail Prices API. Provides tools to propose VM flavors, get full quotes with disk and reservation options, and batch-analyze RVTools exports.
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server that exposes a price calculation tool (calculatePrice) for computing final prices with discount and tax logic, usable by Codex or any MCP client.
      -