BASE="http://127.0.0.1:8005"
curl -s -N -m 12 "$BASE/sse" > /tmp/sse5.txt &
CP=$!
sleep 2
SID=$(cat /tmp/sse5.txt | grep -E "name|tools|result" | head -40
curl -s -m 4 -X POST "$BASE/messages/?session_id=$SID" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"t","version":"1"}}}' >/dev/null
sleep 2
curl -s -m 4 -X POST "$BASE/messages/?session_id=$SID" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"notifications/initialized"}' >/dev/null
sleep 1
curl -s -m 4 -X POST "$BASE/messages/?session_id=$SID" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' >/dev/null
sleep 3
kill $CP 2>/dev/null
cat /tmp/sse5.txt | grep -E "name|tools|result" | head -40
