Skip to content

feat(tools-registry): add agent402-check402 - #25858

Open
agent402-dev wants to merge 1 commit into
vercel:mainfrom
agent402-dev:patch-1
Open

agent402-dev wants to merge 1 commit into
vercel:mainfrom
agent402-dev:patch-1

Conversation

@agent402-dev

Copy link
Copy Markdown

Background

Agents that call x402 paid APIs decide whether to pay from the HTTP 402 answer. The registry already lists x402 toolkits that pay; this adds a tool that only checks a paid endpoint before an agent pays it.

Summary

Adds one entry, agent402-check402, to content/tools-registry/registry.ts (appended at the end, like recent entries). The tool (check402Tool from @agent402-dev/ai-sdk-tools) sends one request without a payment header and reports what the buyer's agent will hit in the 402 answer: payment format, network and asset, price, payTo and resource URL, plus the USDC amount asked. It never signs or pays, and needs no API key or wallet. ai and zod are in the install commands because they are peer dependencies.

End-to-End Verification

In a clean temporary project with the published @agent402-dev/ai-sdk-tools@0.1.0, ai@7.1.1 and zod:

  • The registry code example type-checks (tsc --noEmit --strict, nodenext).
  • check402Tool({ allowLocal: true }) ran inside generateText with MockLanguageModelV4 emitting the tool call (so no provider key), against a local endpoint whose 402 has a Solana exact option without extra.feePayer: 2 steps, tool result fixes: 1 (fee_payer), signedOrPaid: false.
  • With default options the same local http URL is refused ("Only https URLs are checked.").

Limits: this run used a local endpoint only. An earlier run with ai@7.1.0 against a public x402 endpoint returned fixes: 0 with nothing signed or paid.

Checklist

  • All commits are signed (PRs with unsigned commits cannot be merged)
  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Docs: the package README (linked as docsUrl). No changeset, since only the registry content changes.

@vercel

vercel Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

@agent402-dev is attempting to run Vercel CI for a fork pull request of the Vercel Team on Vercel.

A member of the Team first needs to approve it.

@vercel

vercel Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

@agent402-dev is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant