Skip to main content
Glama

Fetch, paying the paywall if there is one

pay_and_fetch
Destructive

Fetches an HTTP(S) URL and, on a 402 x402 paywall, pays through Spend Guard only when policy checks pass; otherwise holds larger or unknown payments for dashboard approval.

Instructions

Fetch a URL and, if it answers HTTP 402 (an x402 paywall), pay it through the user's Spend Guard. The payment goes out only if it fits the user's budget, goes to an address the service is known to use and is not a price spike; larger payments and unknown services wait for the user to approve them on the dashboard. Returns the HTTP status, what was paid (amount, payee, transaction) and the response body. Redirects are not followed. A refused payment is final: tell the user what was refused and why, and do not try to pay another way.

Input Schema

NameRequiredDescriptionDefault
urlYesThe http(s) URL to fetch.
bodyNoRequest body, for POST, PUT and PATCH.
methodNoDefault GET.
headersNoExtra request headers, e.g. {"accept": "application/json"}. Payment, cookie and origin headers are set by the guard or dropped.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare this is an open-world, non-idempotent, destructive (spending) operation, and the description adds substantial context beyond that: the budget/payee/price-spike gating logic, the human-approval escalation, the finality of a refused payment, and the no-redirect behavior. It also describes the return payload, which matters since there is no output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and the 402-payment mechanic are front-loaded, followed by the decision rules, then the return shape and constraints. Every sentence carries distinct operational information with no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 4-parameter tool with no output schema, the description covers the full behavioral picture an agent needs: what triggers payment, when a human must approve, what is returned, and how to handle a refusal. Annotations handle the safety profile and the schema handles parameters, so nothing essential is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and each parameter (url, method, body, headers) is documented in the schema, including the guard dropping payment/cookie/origin headers. The description adds essentially no per-parameter detail, so the baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb (fetch) and resource (URL) and adds the distinguishing twist: it transparently handles HTTP 402 paywalls via the Spend Guard. This is clearly separable from the spending_status and spending_policy siblings, which report on or configure spending rather than performing a fetch-and-pay.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit conditions for when payment proceeds automatically (within budget, known payee, no price spike) versus when it waits for dashboard approval (larger payments, unknown services), and states that redirects are not followed and a refusal must not be worked around. It does not name the sibling tools as alternatives or say when to prefer spending_status/policy first, so it falls short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools