l402-fetch-preview
Check a URL's payment requirements before paying. Returns cost, protocol, and payment method, enabling a confirmation dialog so users can approve or cancel before any satoshis are spent.
Instructions
Preview payment requirements for a URL without spending any sats. Returns cost, protocol, and payment method so a confirmation dialog can be shown. Use this before l402-fetch to give the user a chance to approve or cancel payment. For widget hosts, the result drives a payment confirmation dialog.
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": {
"url": "<url>"
},
"name": "l402-fetch-preview"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to preview payment requirements for | |
| urls | No | Batch: multiple URLs to preview | |
| method | No | HTTP method | GET |
| pubkey | No | Nostr pubkey for xcashu auth | |
| headers | No | Additional request headers |