Skip to main content
Glama

Universal Data — x402 + MPP Payment Setup

api_order_profit

Read-onlyIdempotent

Calculate ecommerce, wholesale and viral-order contribution margin from selling price, cost, delivery, payment/platform fees, ads and units. One call costs 0.01 USDC on Base x402; customer-owned provider credentials use X-Provider-Key header where needed.

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": {
      "selling_price": "<selling_price>",
      "unit_cost": "<unit_cost>"
    },
    "name": "api_order_profit"
  }
}

Input Schema

NameRequiredDescriptionDefault
ordersNoNumber of orders, default 1
unit_costYesGoods cost per order
ads_per_orderNoAd spend attributed per order, default 0
selling_priceYesSelling price per fulfilled order
shipping_costNoShipping and packing cost per order, default 0
platform_fee_pctNoPercentage platform/payment fee on selling price, default 0

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Beyond the annotations, the description discloses two operationally important traits: a per-call cost of 0.01 USDC on Base x402 and a credential requirement via the X-Provider-Key header. That is real context an agent cannot infer from readOnlyHint/idempotentHint. It stops short of describing the returned margin breakdown, which would raise it further.

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?

Two sentences, front-loaded with the computation and followed by the transactional constraints. No filler or restatement of the name. The first sentence is dense with a long input list but every item maps to a real cost driver.

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?

A six-parameter pure calculator with full schema coverage and no output schema; the description covers what is computed, the cost model, the price, and the auth mechanism. The main omission is any indication of what the response contains (a margin figure, a breakdown by order type), which is not strictly required given the absence of an output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema documents all six parameters including defaults; that sets the baseline at 3. The description earns slightly more by grouping the inputs into a coherent cost model (delivery, fees, ads, units), telling the agent these are additive margin components rather than unrelated numbers.

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 ('Calculate') and resource ('contribution margin') and enumerates the cost components it consumes (selling price, cost, delivery, payment/platform fees, ads, units). An agent knows exactly what computation this performs. It does not, however, distinguish itself from margin-adjacent siblings such as api_commerce_bundle_margin or api_commerce_returns_margin.

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 domain vocabulary - call this when you need per-order contribution margin - but there is no explicit when-to-use/when-not statement and no routing to the bundle or returns margin siblings. The only explicit guidance is transactional (price and auth), not selection guidance.

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