l402-fetch
Fetch a URL with automatic payment handling (L402 Lightning + x402 on-chain). Manages credentials, pays automatically when autoPay is true and cost is within budget, and retries. For human wallets, returns a payment page URL or QR code. For x402 services, returns payment details (receiver address...
This record as markdown: /tools/dev-forgesworn-402-mcp/l402-fetch.md
What l402-fetch does on 402
AI agents call l402-fetch to retrieve information from 402 without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
Why l402-fetch is rated Low
Even though l402-fetch only reads data, uncontrolled read access leaks sensitive information and racks up API costs: an agent caught in a retry loop can make thousands of calls a minute without anyone noticing.
Attacks that exploit this kind of access
The rule that runs l402-fetch safely
PolicyLayer is an MCP gateway: it sits between your AI agents and 402, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For l402-fetch, this is the rule to start with:
l402-fetch is read-only, so it stays allowed. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect 402, apply this rule, and every l402-fetch call is checked against it from then on.
Questions about l402-fetch
Fetch a URL with automatic payment handling (L402 Lightning + x402 on-chain). Manages credentials, pays automatically when autoPay is true and cost is within budget, and retries. For human wallets, returns a payment page URL or QR code. For x402 services, returns payment details (receiver address, network, asset, amount) — the user pays in their wallet and provides the transaction hash. Set autoPay to true for seamless access. When a 402 is returned with tiers, present the pricing options to the user and use l402-buy-credits to purchase their chosen tier. For widget hosts, call l402-fetch-preview first to show a payment confirmation dialog before spending. It is categorised as a Read tool in the 402 MCP Server, which means it retrieves data without modifying state.
Register the 402 MCP server in PolicyLayer and add a rule for l402-fetch: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches 402. Nothing to install.
l402-fetch is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the l402-fetch rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for l402-fetch. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
l402-fetch is provided by the 402 MCP server (402-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on 402, and thousands of servers like it.
This server
Across the catalogue