tools: Add Nory x402 payment tools for AI agents#4393
tools: Add Nory x402 payment tools for AI agents#4393TheMemeBanker wants to merge 2 commits intocrewAIInc:mainfrom
Conversation
Added tools for AI agents to make payments using the x402 HTTP protocol: - NoryPaymentRequirementsTool: Get payment requirements for a resource - NoryVerifyPaymentTool: Verify a signed payment before settlement - NorySettlePaymentTool: Submit payment to blockchain (~400ms) - NoryTransactionLookupTool: Look up transaction status - NoryHealthCheckTool: Check service health Supports Solana and 7 EVM chains (Base, Polygon, Arbitrum, Optimism, Avalanche, Sei, IoTeX) with sub-400ms settlement. This enables CrewAI agents to handle HTTP 402 Payment Required responses programmatically. API: https://noryx402.com Docs: https://github.com/TheMemeBanker/x402-pay
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
lib/crewai-tools/src/crewai_tools/tools/nory_x402_tool/nory_x402_tool.py
Outdated
Show resolved
Hide resolved
|
Hi team! Following up on this PR. I'd love to get this merged so CrewAI users can easily integrate blockchain payments into their agent workflows. The x402 protocol enables sub-400ms settlements which works well for real-time agent interactions. Happy to make any changes needed to align with CrewAI's patterns! |
- URL-encode transaction_id in path parameter to prevent injection - Add Nory tools to __all__ exports in tools/__init__.py - Add Nory tools to main package crewai_tools/__init__.py 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Thanks for the Bugbot review! All three issues have been addressed in commit 1fd450f:
The imports |
|
Quick update: We've just published nory-mcp-server to the official MCP registry (io.github.TheMemeBanker/nory-x402), which means Claude and other MCP-compatible agents can now discover and use Nory for payments. This CrewAI integration would complement that nicely, giving CrewAI users the same payment capabilities. All Cursor Bugbot suggestions have been addressed. Ready for review! |
Summary
Added tools for AI agents to make payments using the x402 HTTP protocol:
NoryPaymentRequirementsTool: Get payment requirements for a resourceNoryVerifyPaymentTool: Verify a signed payment before settlementNorySettlePaymentTool: Submit payment to blockchain (~400ms)NoryTransactionLookupTool: Look up transaction statusNoryHealthCheckTool: Check service healthWhy
As AI agents become more autonomous, they need to interact with the real economy. When an agent encounters an HTTP 402 "Payment Required" response, these tools enable it to:
Example Usage
Supported Networks
Links
AI Disclosure
This contribution was developed with assistance from Claude Code (AI pair programming).
Note
Medium Risk
Adds new networked tooling that can initiate on-chain payment settlement via an external API, so failures/misuse impact cost and reliability despite being mostly additive changes.
Overview
Adds a new
nory_x402_toolpackage that lets agents programmatically handle x402 paywalls via the Nory API: fetching payment requirements, verifying and settling signed payments, looking up transaction status, and performing a service health check.Exports the five new tools (
NoryPaymentRequirementsTool,NoryVerifyPaymentTool,NorySettlePaymentTool,NoryTransactionLookupTool,NoryHealthCheckTool) from the top-levelcrewai_toolsandcrewai_tools.toolsmodules, and includes a README documenting usage and the optionalNORY_API_KEYenv var.Written by Cursor Bugbot for commit 1fd450f. This will update automatically on new commits. Configure here.