rwagenthub-mcp 1.0.4 → 1.0.5

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 +2 -9
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -35,7 +35,7 @@ async function callGateway(api, inputs) {
35
35
  });
36
36
  if (res.status === 402) {
37
37
  const body = await res.json().catch(() => ({}));
38
- const reason = body?.error?.invalidReason ?? body?.error ?? "payment_failed";
38
+ const reason = body?.details ?? body?.error?.invalidReason ?? body?.error ?? "payment_failed";
39
39
  throw new Error(`payment_failed:${reason}`);
40
40
  }
41
41
  return res.json();
@@ -104,15 +104,8 @@ async function main() {
104
104
  msg.toLowerCase().includes("insufficient_funds") ||
105
105
  msg.toLowerCase().includes("failed to create payment payload");
106
106
  if (isPaymentError) {
107
- const isNoFunds =
108
- msg.includes("insufficient_funds") ||
109
- msg.toLowerCase().includes("insufficient funds") ||
110
- msg.toLowerCase().includes("failed to create payment payload");
111
- const detail = isNoFunds
112
- ? `Insufficient USDC balance on Base.\nWallet: ${account.address}\n\nTop up your wallet with USDC on Base and try again.`
113
- : `Payment rejected by gateway (${msg.replace("payment_failed:", "")}).\nWallet: ${account.address}`;
114
107
  return {
115
- content: [{ type: "text", text: `Payment failed: ${detail}` }],
108
+ content: [{ type: "text", text: `Payment failed: insufficient USDC balance on Base.\nWallet: ${account.address}\n\nTop up your wallet with USDC on Base and try again.` }],
116
109
  isError: true,
117
110
  };
118
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rwagenthub-mcp",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
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": {