get_pricing
Retrieve current per-receipt pricing for the OpenTerms protocol. Public access requires no API key.
Instructions
Get current per-receipt pricing. Public — no API key needed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- openterms_mcp_server.py:64-67 (registration)Tool registration for 'get_pricing' in the TOOLS list — defines the name, description, and inputSchema (no inputs required).
"name": "get_pricing", "description": "Get current per-receipt pricing. Public — no API key needed.", "inputSchema": {"type": "object", "properties": {}}, }, - openterms_mcp_server.py:256-265 (handler)Handler function for 'get_pricing' — makes a GET request to /v1/pricing (no auth), returns pricing version, per-receipt cost in USDC minor units, and currency.
elif name == "get_pricing": resp = client.get("/v1/pricing", headers=_headers(auth=False)) if resp.status_code == 200: p = resp.json() return ( f"Pricing version: {p.get('version', '?')}\n" f" Per receipt: {p.get('per_receipt', '?')} USDC minor units\n" f" Currency: {p.get('currency', 'USDC')}" ) return _format_error(resp) - openterms_mcp_server.py:487-488 (helper)CLI wrapper — calls handle_tool('get_pricing', {}) when CLI command 'pricing' is used.
if cmd == "pricing": print(handle_tool("get_pricing", {})) - app.py:274-291 (schema)Server-side API endpoint for /v1/pricing — returns pricing info (version, price_per_receipt, currency, free_mode). This is what the MCP handler calls via HTTP GET.
@app.route('/v1/pricing', methods=['GET']) def get_pricing(): if FREE_MODE: return jsonify({ "version": PRICING_VERSION, "price_per_receipt": 0, "currency": "USDC", "decimals": 6, "free_mode": True, "message": "Receipt issuance is free during beta.", }) return jsonify({ "version": PRICING_VERSION, "price_per_receipt": PRICE_PER_RECEIPT, "currency": "USDC", "decimals": 6, "free_mode": False, })