{
  "name": "maximumsats",
  "version": "1.3.1",
  "endpoint": "https://maximumsats.joel-dfd.workers.dev/mcp",
  "methods": [
    "POST"
  ],
  "protocolVersion": "2025-03-26",
  "serverInfo": {
    "name": "maximumsats",
    "version": "1.3.1"
  },
  "tools_count": 52,
  "tools": [
    {
      "name": "ask_bitcoin",
      "description": "Ask a question about Bitcoin, Lightning Network, Nostr, or related topics. Powered by Maximum Sats AI (Llama 3.3 70B). First query per IP per day is free. Accepts L402 (Lightning) or x402 (USDC) payment.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string",
            "description": "Your question about Bitcoin, Lightning, Nostr, or crypto"
          }
        },
        "required": [
          "prompt"
        ]
      }
    },
    {
      "name": "retry_with_payment",
      "description": "Retry a paid query after paying the Lightning invoice. Provide the payment_hash from the original response.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string",
            "description": "Your original question"
          },
          "payment_hash": {
            "type": "string",
            "description": "The payment_hash from the payment_required response"
          }
        },
        "required": [
          "prompt",
          "payment_hash"
        ]
      }
    },
    {
      "name": "wot_score",
      "description": "Look up the Web of Trust score for a Nostr pubkey. Based on PageRank over the Nostr follow graph (51K+ nodes, 618K+ edges).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "pubkey": {
            "type": "string",
            "description": "Nostr hex pubkey to look up"
          }
        },
        "required": [
          "pubkey"
        ]
      }
    },
    {
      "name": "wot_top",
      "description": "Get the top Web of Trust scores on Nostr. Shows the most trusted pubkeys based on PageRank analysis of the follow graph.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "number",
            "description": "Number of top scores to return (max 100)",
            "default": 10
          }
        }
      }
    },
    {
      "name": "bitcoin_stats",
      "description": "Get current Bitcoin and Lightning Network statistics from Maximum Sats.",
      "inputSchema": {
        "type": "object",
        "properties": {}
      }
    },
    {
      "name": "wot_report",
      "description": "Get a detailed Web of Trust analysis report for a Nostr pubkey. Includes trust level assessment, ranking comparison, and recommendations. Costs 100 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "pubkey": {
            "type": "string",
            "description": "Nostr hex pubkey to analyze"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "pubkey"
        ]
      }
    },
    {
      "name": "nostr_summary",
      "description": "Get an AI summary of a Nostr user's profile and activity. Fetches profile stats from nostr.band and enriches with WoT data and AI analysis. Costs 50 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "pubkey": {
            "type": "string",
            "description": "Nostr hex pubkey to summarize"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "pubkey"
        ]
      }
    },
    {
      "name": "ln_analysis",
      "description": "Get AI-powered Lightning Network analysis with real-time data. Fetches current LN statistics from mempool.space and provides expert analysis. Costs 75 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Your question or topic about the Lightning Network"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "query"
        ]
      }
    },
    {
      "name": "bolt11_decode",
      "description": "Decode a Lightning BOLT11 invoice and return structured fields (amount, timestamp, expiry, payment hash, description, etc). Costs 10 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoice": {
            "type": "string",
            "description": "BOLT11 invoice string (lnbc..., lntb..., etc)"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "invoice"
        ]
      }
    },
    {
      "name": "bolt11_inspect",
      "description": "Inspect a Lightning BOLT11 invoice for expiry status, remaining lifetime, and key payment fields. Costs 6 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoice": {
            "type": "string",
            "description": "BOLT11 invoice string (lnbc..., lntb..., etc)"
          },
          "payment_request": {
            "type": "string",
            "description": "Alias for invoice"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "invoice"
        ]
      }
    },
    {
      "name": "bolt11_expiry",
      "description": "Return compact BOLT11 expiry status (remaining seconds, expiration timestamp, urgency bucket). Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoice": {
            "type": "string",
            "description": "BOLT11 invoice string (lnbc..., lntb..., etc)"
          },
          "payment_request": {
            "type": "string",
            "description": "Alias for invoice"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "invoice"
        ]
      }
    },
    {
      "name": "bolt11_amount",
      "description": "Extract normalized amount fields from a BOLT11 invoice, including sats/msats and zero-amount detection. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoice": {
            "type": "string",
            "description": "BOLT11 invoice string (lnbc..., lntb..., etc)"
          },
          "payment_request": {
            "type": "string",
            "description": "Alias for invoice"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "invoice"
        ]
      }
    },
    {
      "name": "bolt11_description",
      "description": "Extract description mode from a BOLT11 invoice, including plaintext description vs description_hash-only invoices. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoice": {
            "type": "string",
            "description": "BOLT11 invoice string (lnbc..., lntb..., etc)"
          },
          "payment_request": {
            "type": "string",
            "description": "Alias for invoice"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "invoice"
        ]
      }
    },
    {
      "name": "bolt11_network",
      "description": "Classify BOLT11 invoice network/currency (mainnet, testnet, signet, regtest) from the invoice HRP fields. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoice": {
            "type": "string",
            "description": "BOLT11 invoice string (lnbc..., lntb..., lnsb..., lnbcrt...)"
          },
          "payment_request": {
            "type": "string",
            "description": "Alias for invoice"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "invoice"
        ]
      }
    },
    {
      "name": "bolt11_payee",
      "description": "Extract payee pubkey details from BOLT11 invoices, including whether an explicit payee tag is present. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoice": {
            "type": "string",
            "description": "BOLT11 invoice string (lnbc..., lntb..., lnsb..., lnbcrt...)"
          },
          "payment_request": {
            "type": "string",
            "description": "Alias for invoice"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "invoice"
        ]
      }
    },
    {
      "name": "bolt11_payment_secret",
      "description": "Extract payment_secret details from BOLT11 invoices, including tag presence, normalized hex length, and basic format checks. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoice": {
            "type": "string",
            "description": "BOLT11 invoice string (lnbc..., lntb..., lnsb..., lnbcrt...)"
          },
          "payment_request": {
            "type": "string",
            "description": "Alias for invoice"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "invoice"
        ]
      }
    },
    {
      "name": "bolt11_created_at",
      "description": "Extract BOLT11 invoice creation timestamp fields (`timestamp`, `created_at`) plus age metadata in seconds/minutes/hours. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoice": {
            "type": "string",
            "description": "BOLT11 invoice string (lnbc..., lntb..., lnsb..., lnbcrt...)"
          },
          "payment_request": {
            "type": "string",
            "description": "Alias for invoice"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "invoice"
        ]
      }
    },
    {
      "name": "bolt11_min_final_cltv",
      "description": "Extract BOLT11 min final CLTV delta (tag c), classify whether it is explicit/default, and return normalized routing-finality metadata. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoice": {
            "type": "string",
            "description": "BOLT11 invoice string (lnbc..., lntb..., lnsb..., lnbcrt...)"
          },
          "payment_request": {
            "type": "string",
            "description": "Alias for invoice"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "invoice"
        ]
      }
    },
    {
      "name": "bolt11_route_hints",
      "description": "Extract BOLT11 route hint metadata (tag r), including hint count and aggregate payload sizing. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoice": {
            "type": "string",
            "description": "BOLT11 invoice string (lnbc..., lntb..., lnsb..., lnbcrt...)"
          },
          "payment_request": {
            "type": "string",
            "description": "Alias for invoice"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "invoice"
        ]
      }
    },
    {
      "name": "bolt11_tag_inventory",
      "description": "Return a normalized BOLT11 tag inventory, including per-tag counts, known/unknown tag coverage, and payload-size totals. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoice": {
            "type": "string",
            "description": "BOLT11 invoice string (lnbc..., lntb..., lnsb..., lnbcrt...)"
          },
          "payment_request": {
            "type": "string",
            "description": "Alias for invoice"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "invoice"
        ]
      }
    },
    {
      "name": "bolt11_fallbacks",
      "description": "Extract BOLT11 fallback-address tag metadata (tag f), including entry count, payload-byte totals, and raw fallback payloads. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoice": {
            "type": "string",
            "description": "BOLT11 invoice string (lnbc..., lntb..., lnsb..., lnbcrt...)"
          },
          "payment_request": {
            "type": "string",
            "description": "Alias for invoice"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "invoice"
        ]
      }
    },
    {
      "name": "bolt11_payment_hash",
      "description": "Extract BOLT11 payment_hash metadata with hex-format validation and tag-p consistency checks. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoice": {
            "type": "string",
            "description": "BOLT11 invoice string (lnbc..., lntb..., lnsb..., lnbcrt...)"
          },
          "payment_request": {
            "type": "string",
            "description": "Alias for invoice"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "invoice"
        ]
      }
    },
    {
      "name": "bolt11_description_hash",
      "description": "Extract BOLT11 description_hash metadata (tag h), including hash format validation and plaintext/hash mode classification. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoice": {
            "type": "string",
            "description": "BOLT11 invoice string (lnbc..., lntb..., lnsb..., lnbcrt...)"
          },
          "payment_request": {
            "type": "string",
            "description": "Alias for invoice"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "invoice"
        ]
      }
    },
    {
      "name": "bolt11_features",
      "description": "Extract BOLT11 feature bits metadata (tag 9), including bitset byte length and parseability checks. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoice": {
            "type": "string",
            "description": "BOLT11 invoice string (lnbc..., lntb..., lnsb..., lnbcrt...)"
          },
          "payment_request": {
            "type": "string",
            "description": "Alias for invoice"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "invoice"
        ]
      }
    },
    {
      "name": "bolt11_signature",
      "description": "Extract BOLT11 signature metadata, including 64-byte signature hex length/format and recovery-id validation. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "invoice": {
            "type": "string",
            "description": "BOLT11 invoice string (lnbc..., lntb..., lnsb..., lnbcrt...)"
          },
          "payment_request": {
            "type": "string",
            "description": "Alias for invoice"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "invoice"
        ]
      }
    },
    {
      "name": "lnurlp_resolve",
      "description": "Resolve a Lightning Address (name@domain) to LNURL-pay metadata including callback, sendable limits, and optional Nostr fields. Costs 15 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Lightning Address, e.g. max@klabo.world"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "address"
        ]
      }
    },
    {
      "name": "lightning_address_parse",
      "description": "Parse a Lightning Address into normalized components and derived LNURLp + nostr.json URLs. Costs 4 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Lightning Address or lightning: URI, e.g. max@klabo.world or lightning:max@klabo.world"
          },
          "identifier": {
            "type": "string",
            "description": "Alias for address"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "address"
        ]
      }
    },
    {
      "name": "bip21_parse",
      "description": "Parse a Bitcoin URI (BIP21) into normalized address, amount, sats, and metadata fields. Costs 4 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "uri": {
            "type": "string",
            "description": "Bitcoin URI, e.g. bitcoin:bc1...?... (or just bc1...)"
          },
          "bip21": {
            "type": "string",
            "description": "Alias for uri"
          },
          "bitcoin_uri": {
            "type": "string",
            "description": "Alias for uri"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "uri"
        ]
      }
    },
    {
      "name": "bip21_build",
      "description": "Build a normalized Bitcoin URI (BIP21) from address plus optional amount and metadata fields. Costs 4 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Destination Bitcoin address (required)."
          },
          "bitcoin_address": {
            "type": "string",
            "description": "Alias for address."
          },
          "amount_sats": {
            "type": "number",
            "description": "Optional integer amount in sats."
          },
          "amount_btc": {
            "type": "string",
            "description": "Optional BTC decimal amount (up to 8 decimals)."
          },
          "amount": {
            "type": "string",
            "description": "Alias for amount_btc."
          },
          "label": {
            "type": "string",
            "description": "Optional BIP21 label field."
          },
          "message": {
            "type": "string",
            "description": "Optional BIP21 message field."
          },
          "lightning": {
            "type": "string",
            "description": "Optional BOLT11 invoice for BIP21 lightning parameter."
          },
          "parameters": {
            "type": "object",
            "description": "Optional extra BIP21 query parameters map (supports arrays)."
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)."
          }
        },
        "required": [
          "address"
        ]
      }
    },
    {
      "name": "bip21_normalize",
      "description": "Normalize a Bitcoin URI (BIP21) into canonical formatting while preserving payment fields and custom parameters. Costs 4 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "uri": {
            "type": "string",
            "description": "Bitcoin URI, e.g. bitcoin:bc1...?amount=0.001&label=Coffee (or just bc1...)"
          },
          "bip21": {
            "type": "string",
            "description": "Alias for uri"
          },
          "bitcoin_uri": {
            "type": "string",
            "description": "Alias for uri"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "uri"
        ]
      }
    },
    {
      "name": "nip05_verify",
      "description": "Verify a NIP-05 identifier (name@domain) against nostr.json and optionally check expected pubkey match. Costs 20 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "identifier": {
            "type": "string",
            "description": "NIP-05 identifier, e.g. satoshi@nostr.example"
          },
          "pubkey": {
            "type": "string",
            "description": "Optional expected 64-char hex pubkey to compare against nostr.json"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "identifier"
        ]
      }
    },
    {
      "name": "bolt12_decode",
      "description": "Decode a BOLT12 offer (lno1...) into structured fields including amount, description, expiry, payer metadata. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "offer": {
            "type": "string",
            "description": "BOLT12 offer string (lno1... for mainnet, lnbo1... for testnet)"
          },
          "bolt12": {
            "type": "string",
            "description": "Alias for offer"
          },
          "offer_string": {
            "type": "string",
            "description": "Alias for offer"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "offer"
        ]
      }
    },
    {
      "name": "npub_decode",
      "description": "Decode a Nostr npub identifier into canonical 64-char hex pubkey. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "npub": {
            "type": "string",
            "description": "Nostr npub identifier, e.g. npub1..."
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "npub"
        ]
      }
    },
    {
      "name": "npub_encode",
      "description": "Encode a canonical 64-char hex pubkey into a Nostr npub identifier. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "pubkey": {
            "type": "string",
            "description": "Nostr hex pubkey (64 hex chars)"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "pubkey"
        ]
      }
    },
    {
      "name": "nprofile_decode",
      "description": "Decode a Nostr nprofile identifier into pubkey + relay hints from TLV records. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "nprofile": {
            "type": "string",
            "description": "Nostr nprofile identifier, e.g. nprofile1..."
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "nprofile"
        ]
      }
    },
    {
      "name": "nprofile_encode",
      "description": "Encode a canonical 64-char hex pubkey (with optional relay hints) into a Nostr nprofile identifier. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "pubkey": {
            "type": "string",
            "description": "Nostr hex pubkey (64 hex chars)"
          },
          "hex_pubkey": {
            "type": "string",
            "description": "Alias for pubkey"
          },
          "relays": {
            "type": "array",
            "description": "Optional relay hint URLs (ws/wss), e.g. [\"wss://relay.damus.io\"]",
            "items": {
              "type": "string"
            }
          },
          "relay": {
            "type": "string",
            "description": "Optional single relay hint URL alias (ws/wss)"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "pubkey"
        ]
      }
    },
    {
      "name": "nevent_decode",
      "description": "Decode a Nostr nevent identifier into event id + relay hints (and optional author/kind) from TLV records. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "nevent": {
            "type": "string",
            "description": "Nostr nevent identifier, e.g. nevent1..."
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "nevent"
        ]
      }
    },
    {
      "name": "nevent_encode",
      "description": "Encode a canonical 64-char hex event id into a Nostr nevent identifier with optional relay hints, author pubkey, and kind. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "event_id": {
            "type": "string",
            "description": "Nostr hex event id (64 hex chars)"
          },
          "hex_event_id": {
            "type": "string",
            "description": "Alias for event_id"
          },
          "relays": {
            "type": "array",
            "description": "Optional relay hint URLs (ws/wss), e.g. [\"wss://relay.damus.io\"]",
            "items": {
              "type": "string"
            }
          },
          "relay": {
            "type": "string",
            "description": "Optional single relay hint URL alias (ws/wss)"
          },
          "author_pubkey": {
            "type": "string",
            "description": "Optional 64-char hex author pubkey (type 2 TLV)"
          },
          "hex_author_pubkey": {
            "type": "string",
            "description": "Alias for author_pubkey"
          },
          "kind": {
            "type": "number",
            "description": "Optional event kind as uint32 (0..4294967295) (type 3 TLV)"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "event_id"
        ]
      }
    },
    {
      "name": "naddr_decode",
      "description": "Decode a Nostr naddr identifier into identifier + author pubkey + kind (+ relay hints) from TLV records. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "naddr": {
            "type": "string",
            "description": "Nostr naddr identifier, e.g. naddr1..."
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "naddr"
        ]
      }
    },
    {
      "name": "naddr_encode",
      "description": "Encode identifier + author pubkey + kind (+ optional relay hints) into a Nostr naddr identifier. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "identifier": {
            "type": "string",
            "description": "Nostr address identifier (d-tag), e.g. my-article-slug"
          },
          "d": {
            "type": "string",
            "description": "Alias for identifier"
          },
          "author_pubkey": {
            "type": "string",
            "description": "Nostr hex author pubkey (64 hex chars)"
          },
          "hex_author_pubkey": {
            "type": "string",
            "description": "Alias for author_pubkey"
          },
          "author": {
            "type": "string",
            "description": "Alias for author_pubkey"
          },
          "kind": {
            "type": "number",
            "description": "Event kind as uint32 (0..4294967295)"
          },
          "relays": {
            "type": "array",
            "description": "Optional relay hint URLs (ws/wss), e.g. [\"wss://relay.damus.io\"]",
            "items": {
              "type": "string"
            }
          },
          "relay": {
            "type": "string",
            "description": "Optional single relay hint URL alias (ws/wss)"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "identifier",
          "author_pubkey",
          "kind"
        ]
      }
    },
    {
      "name": "nrelay_decode",
      "description": "Decode a Nostr nrelay identifier into normalized relay URL(s) from TLV records. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "nrelay": {
            "type": "string",
            "description": "Nostr nrelay identifier, e.g. nrelay1..."
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "nrelay"
        ]
      }
    },
    {
      "name": "note_decode",
      "description": "Decode a Nostr note identifier into canonical 64-char hex event id. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "note": {
            "type": "string",
            "description": "Nostr note identifier, e.g. note1..."
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "note"
        ]
      }
    },
    {
      "name": "note_encode",
      "description": "Encode a canonical 64-char hex event id into a Nostr note identifier. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "event_id": {
            "type": "string",
            "description": "Nostr hex event id (64 hex chars)"
          },
          "hex_event_id": {
            "type": "string",
            "description": "Alias for event_id"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "event_id"
        ]
      }
    },
    {
      "name": "lnurl_decode",
      "description": "Decode a bech32 LNURL string into the underlying callback URL. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "lnurl": {
            "type": "string",
            "description": "LNURL bech32 string, e.g. lnurl1..."
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "lnurl"
        ]
      }
    },
    {
      "name": "lnurl_encode",
      "description": "Encode a callback URL (or Lightning Address-derived LNURLp URL) into a bech32 LNURL string. Costs 5 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Absolute callback URL to encode, e.g. https://example.com/.well-known/lnurlp/max"
          },
          "address": {
            "type": "string",
            "description": "Optional Lightning Address (name@domain). If set, encodes its derived LNURLp URL."
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        }
      }
    },
    {
      "name": "nostr_id_inspect",
      "description": "Inspect and decode a Nostr bech32 identifier (npub, note, nprofile, nevent, naddr, nrelay). Costs 6 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "identifier": {
            "type": "string",
            "description": "Nostr bech32 identifier to inspect, e.g. npub1..., note1..., nprofile1..."
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "identifier"
        ]
      }
    },
    {
      "name": "proof_replay_generate",
      "description": "Generate resilient L402 paid-retry templates (query/header/auth variants) for any endpoint. Costs 7 sats via L402. Quickstart: https://maximumsats.com/blog/l402-proof-replay-quickstart",
      "inputSchema": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Target endpoint URL to replay against, e.g. https://example.com/api/paid"
          },
          "method": {
            "type": "string",
            "description": "HTTP method (GET/POST/PUT/PATCH/DELETE). Defaults to POST."
          },
          "headers": {
            "type": "object",
            "description": "Optional request headers map, e.g. {\"Content-Type\":\"application/json\"}"
          },
          "body": {
            "description": "Optional request body. Can be a string or JSON object."
          },
          "macaroon": {
            "type": "string",
            "description": "Optional L402 macaroon for macaroon:proof Authorization format."
          },
          "proof": {
            "type": "string",
            "description": "Optional proof/preimage token for macaroon:proof Authorization format."
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "url"
        ]
      }
    },
    {
      "name": "l402_parse",
      "description": "Parse L402 challenge payloads and WWW-Authenticate headers into normalized fields (invoice, payment_hash, macaroon, token). Costs 8 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "www_authenticate": {
            "type": "string",
            "description": "Raw WWW-Authenticate header value, e.g. L402 invoice=\"lnbc...\", payment_hash=\"...\""
          },
          "challenge": {
            "description": "Optional JSON challenge object/body from a 402 response."
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        }
      }
    },
    {
      "name": "l402_hash_verify",
      "description": "Verify payment_hash consistency across L402 challenge/header fields, BOLT11 invoice tags, and retry hash values. Costs 8 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "endpoint_payment_hash": {
            "type": "string",
            "description": "Expected payment hash from target endpoint challenge (preferred when known)."
          },
          "www_authenticate": {
            "type": "string",
            "description": "Optional WWW-Authenticate header, e.g. L402 invoice=\"lnbc...\", payment_hash=\"...\""
          },
          "challenge": {
            "description": "Optional 402 challenge JSON object/body."
          },
          "invoice": {
            "type": "string",
            "description": "Optional BOLT11 invoice (lnbc...) to decode payment_hash from tag p."
          },
          "retry_payment_hash": {
            "type": "string",
            "description": "Optional hash sent on failed retry (query/header/auth)."
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash for this tool after paying the Lightning invoice."
          }
        }
      }
    },
    {
      "name": "l402_auth_build",
      "description": "Build L402 retry auth variants (query/header/Authorization) from challenge data and payment hash. Costs 9 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "endpoint_payment_hash": {
            "type": "string",
            "description": "Payment hash from the target paid endpoint (not this tool invoice hash)."
          },
          "www_authenticate": {
            "type": "string",
            "description": "Optional WWW-Authenticate header, e.g. L402 invoice=\"lnbc...\", payment_hash=\"...\""
          },
          "challenge": {
            "description": "Optional 402 challenge JSON object/body."
          },
          "macaroon": {
            "type": "string",
            "description": "Optional macaroon for Authorization: L402 <macaroon>:<proof>."
          },
          "proof": {
            "type": "string",
            "description": "Optional proof/preimage/token for Authorization macaroon:proof format."
          },
          "url": {
            "type": "string",
            "description": "Optional target endpoint URL. When provided, curl examples are generated."
          },
          "method": {
            "type": "string",
            "description": "Optional HTTP method (default POST)."
          },
          "headers": {
            "type": "object",
            "description": "Optional base headers to include in generated variants."
          },
          "body": {
            "description": "Optional request body to include in generated curl examples."
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash for this tool after paying the Lightning invoice."
          }
        }
      }
    },
    {
      "name": "l402_auth_diagnose",
      "description": "Diagnose failed L402 paid retries (401/402) and generate the next auth plan for strict providers. Costs 9 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "endpoint_payment_hash": {
            "type": "string",
            "description": "Payment hash from the target paid endpoint (preferred when known)."
          },
          "www_authenticate": {
            "type": "string",
            "description": "Optional original 402 WWW-Authenticate header from the target endpoint."
          },
          "challenge": {
            "description": "Optional original 402 challenge JSON object/body."
          },
          "retry_status": {
            "type": "number",
            "description": "HTTP status from failed paid retry (commonly 401 or 402)."
          },
          "retry_error": {
            "type": "string",
            "description": "Error text/body excerpt from failed paid retry."
          },
          "retry_www_authenticate": {
            "type": "string",
            "description": "Optional WWW-Authenticate header from failed paid retry response."
          },
          "retry_challenge": {
            "description": "Optional failed paid retry response JSON/body."
          },
          "attempt_headers": {
            "type": "object",
            "description": "Headers used on the failed paid retry request."
          },
          "attempt_url": {
            "type": "string",
            "description": "URL used on failed paid retry request (used to detect query payment_hash)."
          },
          "method": {
            "type": "string",
            "description": "HTTP method used for replay plan output (default POST)."
          },
          "macaroon": {
            "type": "string",
            "description": "Optional macaroon when provider expects Authorization: L402 <macaroon>:<proof>."
          },
          "proof": {
            "type": "string",
            "description": "Optional proof/preimage/token when provider expects macaroon:proof auth."
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash for this tool after paying the Lightning invoice."
          }
        }
      }
    },
    {
      "name": "generate_image",
      "description": "Generate an image from a text prompt using FLUX AI model. Returns a PNG image. Costs 100 sats via L402.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string",
            "description": "Text description of the image to generate (max 2048 chars)"
          },
          "payment_hash": {
            "type": "string",
            "description": "Payment hash after paying the Lightning invoice (optional, omit for invoice)"
          }
        },
        "required": [
          "prompt"
        ]
      }
    }
  ],
  "note": "Use POST /mcp for MCP JSON-RPC. This GET response exists for humans/crawlers."
}