@blockrun/mcp 0.23.1 → 0.23.2
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.
- package/dist/index.js +11 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -423,17 +423,23 @@ ${parts.join("\n")}`;
|
|
|
423
423
|
}
|
|
424
424
|
return base;
|
|
425
425
|
}
|
|
426
|
-
function formatError(message) {
|
|
426
|
+
function formatError(message, opts) {
|
|
427
427
|
const msgLower = message.toLowerCase();
|
|
428
428
|
const hasStatus = (code) => new RegExp(`(^|[^0-9.])${code}([^0-9]|$)`).test(msgLower);
|
|
429
429
|
const isPaymentError = hasStatus("402") || msgLower.includes("balance") || msgLower.includes("insufficient") || msgLower.includes("payment") && !hasStatus("500");
|
|
430
|
+
const isModelUnavailable = msgLower.includes("not active for requested provider") || msgLower.includes("not found or not active");
|
|
430
431
|
const isServerError = hasStatus("500") || msgLower.includes("api error after payment");
|
|
432
|
+
const altHint = opts?.altModels ? ` (e.g. ${opts.altModels})` : "";
|
|
431
433
|
let errorText = `Error: ${message}`;
|
|
432
|
-
if (
|
|
434
|
+
if (isModelUnavailable) {
|
|
435
|
+
errorText += `
|
|
436
|
+
|
|
437
|
+
This model is temporarily unavailable upstream` + (opts?.altModels ? `. Try a different model${altHint} \u2014 it should work right away.` : `. Try a different model, or retry shortly.`);
|
|
438
|
+
} else if (isServerError) {
|
|
433
439
|
errorText += `
|
|
434
440
|
|
|
435
441
|
This is a temporary API issue. The API may be experiencing problems.
|
|
436
|
-
Try again in a few minutes
|
|
442
|
+
Try again in a few minutes` + (opts?.altModels ? `, or use a different model${altHint}.` : `.`);
|
|
437
443
|
} else if (isPaymentError) {
|
|
438
444
|
const chain = getChain();
|
|
439
445
|
const network = chain === "solana" ? "Solana" : "Base";
|
|
@@ -1395,7 +1401,7 @@ Error: ${errMsg}` }],
|
|
|
1395
1401
|
};
|
|
1396
1402
|
}
|
|
1397
1403
|
return {
|
|
1398
|
-
content: [{ type: "text", text: formatError(`Image generation failed: ${errMsg}
|
|
1404
|
+
content: [{ type: "text", text: formatError(`Image generation failed: ${errMsg}`, { altModels: "google/nano-banana, zai/cogview-4" }) }],
|
|
1399
1405
|
isError: true
|
|
1400
1406
|
};
|
|
1401
1407
|
}
|
|
@@ -2062,7 +2068,7 @@ Error: ${errMsg}` }],
|
|
|
2062
2068
|
};
|
|
2063
2069
|
}
|
|
2064
2070
|
return {
|
|
2065
|
-
content: [{ type: "text", text: formatError(`Video generation failed: ${errMsg}
|
|
2071
|
+
content: [{ type: "text", text: formatError(`Video generation failed: ${errMsg}`, { altModels: "bytedance/seedance-2.0, azure/sora-2" }) }],
|
|
2066
2072
|
isError: true
|
|
2067
2073
|
};
|
|
2068
2074
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockrun/mcp",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.2",
|
|
4
4
|
"mcpName": "io.github.BlockRunAI/blockrun-mcp",
|
|
5
5
|
"description": "BlockRun MCP Server - Give your AI agent web search, deep research, prediction markets, crypto data, X/Twitter intelligence. Paid via x402 micropayments.",
|
|
6
6
|
"type": "module",
|