feat(langchain): add X402SearchTool for API discovery#1
feat(langchain): add X402SearchTool for API discovery#1x402-index wants to merge 2 commits intoxpaysh:mainfrom
Conversation
Updates in this revisionFixed three issues in 1. Wrong base class — changed from 2. Query params never sent — 3. Wrong chainId — All three issues would have caused silent failures — the tool would have been importable but non-functional. The fix is contained to |
|
Hi — wanted to make the review as easy as possible: What this does: Adds Two bugs fixed in this revision:
Working example: import { X402SearchTool } from '@xpaysh/agent-kit-langchain';
const tool = new X402SearchTool({
privateKey: process.env.WALLET_PRIVATE_KEY,
chainId: 8453,
});
// Tool name: search_apis
// Cost: $0.01 USDC per query via x402 on Base mainnet — paid automatically
// Returns ranked list of x402-payable endpoints with name, description, urlHappy to address any feedback before review. |
Summary
Adds X402SearchTool — a native LangChain tool that gives xpaysh agents natural language search across 14,000+ indexed API services.
Why
This kit already enables agents to pay for APIs autonomously. This tool adds the missing piece: finding which API to call in the first place.
The full autonomous loop: discover -> pay -> call. No human in the loop at any step.
What
Usage
import { X402SearchTool } from '@xpaysh/agent-kit-langchain';
const searchTool = new X402SearchTool({
privateKey: process.env.PRIVATE_KEY,
spendingLimits: { perCallLimit: 0.01 }
});
Best queries
Links