rwagenthub-mcp 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +11 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -92,6 +92,17 @@ async function main() {
92
92
  content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }],
93
93
  };
94
94
  } catch (err) {
95
+ const msg = err.message ?? "";
96
+ const isInsufficientFunds =
97
+ msg.toLowerCase().includes("insufficient funds") ||
98
+ msg.toLowerCase().includes("insufficient_funds") ||
99
+ msg.toLowerCase().includes("failed to create payment payload");
100
+ if (isInsufficientFunds) {
101
+ return {
102
+ content: [{ type: "text", text: `Payment failed: insufficient USDC balance on Base.\nWallet: ${account.address}\n\nTop up your wallet with USDC on Base network and try again.` }],
103
+ isError: true,
104
+ };
105
+ }
95
106
  return {
96
107
  content: [{ type: "text", text: `Gateway error: ${err.message}` }],
97
108
  isError: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rwagenthub-mcp",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "MCP server for AgentHub — 19 AI APIs (flights, weather, crypto, search, DeFi, code execution...) paid via x402 USDC on Base",
5
5
  "type": "module",
6
6
  "bin": {