Recomputes a usage-based bill from a customer-supplied tariff (graduated per-meter tiers, optional included allowances, optional fixed charges) and aggregated metered usage, using exact decimal arithmetic. Does not fetch or embed any vendor pricing; it only applies the rules the caller provides, and checks the result against an optional supplied invoice total.
0.05 per analysis
Requires x402 capable MCP client with wallet for payment settlement.
{
"type": "object",
"additionalProperties": false,
"required": [
"currency",
"minor_unit_digits",
"meters"
],
"properties": {
"currency": {
"type": "string",
"pattern": "^[A-Za-z0-9]{1,10}$"
},
"minor_unit_digits": {
"type": "integer",
"minimum": 0,
"maximum": 6
},
"meters": {
"type": "array",
"maxItems": 100,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"quantity",
"tiers"
],
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"quantity": {
"type": "string",
"description": "nonnegative decimal, <=6 fractional digits"
},
"included_quantity": {
"type": "string",
"description": "nonnegative decimal, <=6 fractional digits"
},
"tiers": {
"type": "array",
"minItems": 1,
"maxItems": 20,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"up_to",
"unit_price"
],
"properties": {
"up_to": {
"type": [
"string",
"null"
],
"description": "nonnegative decimal or null for the final unlimited tier"
},
"unit_price": {
"type": "string",
"description": "nonnegative decimal, <=9 fractional digits"
}
}
}
}
}
}
},
"fixed_charges": {
"type": "array",
"maxItems": 100,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"amount"
],
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"amount": {
"type": "string",
"description": "nonnegative decimal, <=9 fractional digits"
}
}
}
},
"invoice_total": {
"type": "string",
"description": "nonnegative decimal, at most minor_unit_digits fractional digits; never rounded"
}
}
}
{
"currency": "USD",
"minor_unit_digits": 2,
"meters": [
{
"id": "requests",
"quantity": "1250000",
"included_quantity": "1000000",
"tiers": [
{
"up_to": "100000",
"unit_price": "0.0000005"
},
{
"up_to": "500000",
"unit_price": "0.0000003"
},
{
"up_to": null,
"unit_price": "0.0000002"
}
]
},
{
"id": "storage_gb_hours",
"quantity": "500.5",
"tiers": [
{
"up_to": null,
"unit_price": "0.02"
}
]
}
],
"fixed_charges": [
{
"id": "platform_fee",
"amount": "5.00"
},
{
"id": "support_plan",
"amount": "12.345"
}
],
"invoice_total": "27.46"
}
{
"ok": true,
"currency": "USD",
"minor_unit_digits": 2,
"meters": [
{
"id": "requests",
"usage_quantity": "1250000",
"included_quantity": "1000000",
"billable_quantity": "250000",
"tiers": [
{
"quantity": "100000",
"unit_price": "0.0000005",
"unrounded_cost": "0.05"
},
{
"quantity": "150000",
"unit_price": "0.0000003",
"unrounded_cost": "0.045"
},
{
"quantity": "0",
"unit_price": "0.0000002",
"unrounded_cost": "0"
}
],
"total_minor": "10"
},
{
"id": "storage_gb_hours",
"usage_quantity": "500.5",
"included_quantity": "0",
"billable_quantity": "500.5",
"tiers": [
{
"quantity": "500.5",
"unit_price": "0.02",
"unrounded_cost": "10.01"
}
],
"total_minor": "1001"
}
],
"fixed_charges": [
{
"id": "platform_fee",
"total_minor": "500"
},
{
"id": "support_plan",
"total_minor": "1235"
}
],
"total_minor": "2746",
"invoice_total_minor": "2746",
"difference_minor": "0",
"matches_invoice": true
}
Add to your MCP client configuration:
{
"mcpServers": {
"usage-bill-reconstructor": {
"type": "http",
"url": "https://mcp-factory.bowling-anthony.workers.dev/usage-bill-reconstructor/mcp"
}
}
}
Price: 0.05 USDC per analysis
This tool requires an x402-capable MCP client with wallet support. Tool listing and initialization are free. Actual completed job analysis is paid in USDC on the Base network.
Payment flow: