test(smoke): aggiunti live tool check read-only su 6 MCP

This commit is contained in:
AdrianoDev
2026-04-27 22:11:47 +02:00
parent 1dbf9bbd7b
commit 81fb5e8c29
+45
View File
@@ -58,6 +58,51 @@ for ex in deribit bybit hyperliquid alpaca; do
fi fi
done done
echo
echo "=== live tool check (read-only contro upstream testnet) ==="
_check_tool() {
local label="$1" url="$2" body="$3"
local resp
resp=$(curl -s -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "$body" \
"$url" 2>/dev/null || echo '{}')
if echo "$resp" | jq -e 'has("error") | not' > /dev/null 2>&1 \
&& [ -n "$resp" ] && [ "$resp" != "null" ] && [ "$resp" != "{}" ]; then
echo " $label: OK"
else
echo " $label: FAIL"
echo " body: $(echo "$resp" | head -c 200)"
fail=$((fail + 1))
fi
}
_check_tool "deribit get_ticker BTC-PERPETUAL" \
"$GATEWAY/mcp-deribit/tools/get_ticker" \
'{"instrument_name":"BTC-PERPETUAL"}'
_check_tool "bybit get_ticker BTCUSDT" \
"$GATEWAY/mcp-bybit/tools/get_ticker" \
'{"symbol":"BTCUSDT","category":"linear"}'
_check_tool "hyperliquid get_ticker BTC" \
"$GATEWAY/mcp-hyperliquid/tools/get_ticker" \
'{"instrument":"BTC"}'
_check_tool "alpaca get_clock (richiede ALPACA_PAPER credenziali valide)" \
"$GATEWAY/mcp-alpaca/tools/get_clock" \
'{}'
_check_tool "macro get_treasury_yields" \
"$GATEWAY/mcp-macro/tools/get_treasury_yields" \
'{}'
_check_tool "sentiment get_funding_rates BTC" \
"$GATEWAY/mcp-sentiment/tools/get_funding_rates" \
'{"asset":"BTC"}'
echo echo
if [ "$fail" -gt 0 ]; then if [ "$fail" -gt 0 ]; then
echo "SMOKE FAILED: $fail check(s) failed" echo "SMOKE FAILED: $fail check(s) failed"