Skip to content

Bazaar: seller-side discovery metadata helpers (and list Lens's own endpoints) #134

Description

@Miracle656

Context

From §3.2 of the RFP:

"Seller side helpers so a resource server can declare discovery metadata correctly, including per parameter descriptions that make an endpoint legible to an agent, with minimal boilerplate."

And from §3.6, the UX bar:

"A developer should get from docs to a paid, discoverable endpoint appearing in the Bazaar in well under an hour."

Why per-parameter descriptions matter more than they sound

The buyer is software. An agent choosing between two price feeds cannot open your docs — it has only what the listing declares. An endpoint described as GET /price/:assetA/:assetB is nearly useless to it; one that declares what assetA accepts, what the response contains, and what it costs is selectable. Metadata quality is what ranking in #129 has to rank on — poor descriptions cap search quality no matter how good the retrieval is.

Scope

Helpers a resource server can use to declare discovery metadata with minimal ceremony:

  • Declare a resource, its parameters with descriptions, its pricing and its network
  • Emit the discovery extension correctly on the payment path so automatic cataloging (Bazaar: automatic cataloging from the discovery extension #130) picks it up
  • Validate locally, before anything is sent, so a seller finds out their metadata is malformed at development time rather than from an EXTENSION-RESPONSES header in production
  • Cover both HTTP endpoints and MCP tools

Dogfood it

Lens is itself an x402 seller — src/middleware/x402.ts gates /price, /pools, /candles, /ws. Use these helpers to make Lens's own endpoints discoverable. If declaring metadata for our own price feed is awkward, it will be awkward for everyone else, and we will find that out before shipping rather than after. That also makes Lens the first listing in its own Bazaar, which is a reasonable demo in its own right.

Acceptance criteria

  • A resource server can declare a discoverable, priced endpoint in a few lines
  • Per-parameter descriptions are first-class, not an afterthought
  • Local validation catches malformed metadata before it is sent
  • Both HTTP and MCP resource types supported
  • Lens's own gated routes are declared using it, and appear in the catalog
  • A developer following the README gets from nothing to a listed endpoint in well under an hour — say in the PR how long it actually took someone who had not seen it before

Drips Wave · Complexity: Medium · 150 points


Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions