L402 Gateway
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LNBITS_URL | Yes | LNbits instance URL | |
| ENCRYPTION_KEY | Yes | AES-256-GCM key for tenant secrets | |
| MACAROON_SECRET | Yes | HMAC key for macaroon signing | |
| LNBITS_ADMIN_KEY | Yes | LNbits admin API key | |
| GATEWAY_ADMIN_TOKEN | Yes | Admin auth token |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| l402_requestA | Run the full L402 flow: request a URL, detect the 402 challenge, pay the invoice via LNbits, retry with Authorization, and return the unlocked response. |
| l402_inspectC | Decode an L402 macaroon and show its identifier and caveats. |
| l402_checkA | Probe a URL to see whether it is L402-protected, and report the invoice price and macaroon caveats when present. |
| l402_create_resourceC | Create or update a protected resource on the configured L402 gateway. |
| l402_list_resourcesB | List resources from the configured L402 gateway. |
| l402_delete_resourceC | Delete a resource from the configured L402 gateway. |
| l402_statsB | Fetch gateway payment and usage statistics from the configured L402 gateway. |
| l402_balanceB | Check the configured LNbits wallet balance. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 8 tools
Each tool targets a distinct action (inspect, request, check, create/list/delete resources, stats, balance). There is some conceptual overlap between l402_check (probes URL, reports caveats) and l402_inspect (decodes macaroon) plus l402_request (also detects the 402 challenge), but the descriptions clarify the boundaries well enough for an agent to pick correctly.
All tools share the l402_ prefix and use a predictable verb_noun pattern (l402_create_resource, l402_list_resources, l402_delete_resource). The noun-only tools (l402_stats, l402_balance) are naturally read-only fetches and remain consistent with the scheme.
Eight tools is well-scoped for a gateway server covering resource CRUD, payment flow, macaroon inspection, and wallet/stat queries. Each tool earns its place with no filler.
The surface covers the core L402 lifecycle: resource CRUD (create/update, list, delete), payment flow, macaroon inspection, wallet balance, and stats. Minor gaps exist (no dedicated get-single-resource or standalone invoice-payment/macaroon-issuance tool), but agents can work around these via list and l402_request.