list_receipts
Retrieve recent workspace receipts to track cryptographic consent proofs, filter by action type, and monitor spending caps with verifiable records.
Instructions
List recent receipts for this workspace.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max receipts to return (default 10, max 50) | |
| action_type | No | Filter by action type |
Implementation Reference
- openterms_mcp_server.py:267-288 (handler)The handler implementation for the list_receipts tool, which makes a GET request to the /v1/receipts API endpoint and formats the results.
elif name == "list_receipts": params = {} if arguments.get("limit"): params["limit"] = min(arguments["limit"], 50) if arguments.get("action_type"): params["action_type"] = arguments["action_type"] resp = client.get("/v1/receipts", params=params, headers=_headers()) if resp.status_code == 200: data = resp.json() receipts = data.get("receipts", data) if isinstance(data, dict) else data if not receipts: return "No receipts found." lines = [f"Found {len(receipts)} receipt(s):"] for r in receipts[:10]: lines.append( f" [{r.get('action_type')}] {r.get('receipt_id', '?')[:12]}... " f"— {r.get('terms_url', '?')} ({r.get('created_at', '?')})" ) if len(receipts) > 10: lines.append(f" ... and {len(receipts) - 10} more") return "\n".join(lines) return _format_error(resp) - openterms_mcp_server.py:69-78 (schema)The schema definition for the list_receipts tool, defining the accepted input parameters.
"name": "list_receipts", "description": "List recent receipts for this workspace.", "inputSchema": { "type": "object", "properties": { "limit": {"type": "integer", "description": "Max receipts to return (default 10, max 50)"}, "action_type": {"type": "string", "description": "Filter by action type"}, }, }, },