provider_activity
Monitor and analyze API usage by viewing receipt activity, statistics, and unique agents for your terms URL to track consent verification.
Instructions
View receipt activity against your terms URL (requires provider API key via OPENTERMS_PROVIDER_KEY). Shows stats, unique agents, and recent receipts for your API.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max receipts to return (default 10) |
Implementation Reference
- openterms_mcp_server.py:391-414 (handler)The implementation of the `provider_activity` tool, which fetches provider statistics from the OpenTerms API.
elif name == "provider_activity": if not PROVIDER_KEY: return "❌ OPENTERMS_PROVIDER_KEY not set. Register as a provider first." # Get stats resp = client.get("/v1/provider/stats", headers=_provider_headers()) if resp.status_code != 200: return _format_error(resp) stats = resp.json() lines = [ f"📊 Provider Activity", f" Provider: {stats.get('provider_id', 'n/a')}", f" Verified: {'✅' if stats.get('verified') else '❌'}", f" Receipts (total): {stats.get('receipts_total', 0)}", f" Receipts (24h): {stats.get('receipts_24h', 0)}", f" Receipts (7d): {stats.get('receipts_7d', 0)}", f" Receipts (30d): {stats.get('receipts_30d', 0)}", f" Unique agents: {stats.get('unique_agents', 0)}", ] breakdown = stats.get('action_type_breakdown', {}) if breakdown: lines.append(" Action types:") for atype, count in breakdown.items(): lines.append(f" {atype}: {count}") return "\n".join(lines) - openterms_mcp_server.py:135-147 (schema)Definition of the `provider_activity` tool's input schema and description.
{ "name": "provider_activity", "description": ( "View receipt activity against your terms URL (requires provider API key via OPENTERMS_PROVIDER_KEY). " "Shows stats, unique agents, and recent receipts for your API." ), "inputSchema": { "type": "object", "properties": { "limit": {"type": "integer", "description": "Max receipts to return (default 10)"}, }, }, },