@rashidazarang/airtable-mcp 1.2.4 → 1.5.0

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.
@@ -0,0 +1,105 @@
1
+ #!/bin/bash
2
+
3
+ echo "🪝 TESTING WEBHOOK FUNCTIONALITY"
4
+ echo "================================"
5
+ echo ""
6
+
7
+ # Test 1: List webhooks
8
+ echo "1️⃣ LIST WEBHOOKS"
9
+ echo "-----------------"
10
+ result=$(curl -s -X POST http://localhost:8010/mcp \
11
+ -H "Content-Type: application/json" \
12
+ -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "list_webhooks"}}')
13
+
14
+ if echo "$result" | grep -q "webhook\\|No webhooks"; then
15
+ echo "✅ PASSED: list_webhooks working"
16
+ echo "$result" | python3 -c "import sys, json; print(json.load(sys.stdin)['result']['content'][0]['text'])"
17
+ else
18
+ echo "❌ FAILED: list_webhooks error"
19
+ echo "$result" | python3 -m json.tool
20
+ fi
21
+ echo ""
22
+
23
+ # Test 2: Create webhook
24
+ echo "2️⃣ CREATE WEBHOOK"
25
+ echo "------------------"
26
+ result=$(curl -s -X POST http://localhost:8010/mcp \
27
+ -H "Content-Type: application/json" \
28
+ -d '{"jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": {"name": "create_webhook", "arguments": {"notificationUrl": "https://webhook.site/test-webhook"}}}')
29
+
30
+ if echo "$result" | grep -q "Successfully created webhook"; then
31
+ echo "✅ PASSED: create_webhook working"
32
+ # Extract webhook ID
33
+ WEBHOOK_ID=$(echo "$result" | grep -o 'ach[a-zA-Z0-9]*' | head -1)
34
+ echo "Created webhook ID: $WEBHOOK_ID"
35
+ echo "$result" | python3 -c "import sys, json; t=json.load(sys.stdin)['result']['content'][0]['text']; print(t[:300])"
36
+ else
37
+ echo "❌ FAILED: create_webhook error"
38
+ echo "$result" | python3 -m json.tool | head -20
39
+ fi
40
+ echo ""
41
+
42
+ # Test 3: List webhooks again
43
+ echo "3️⃣ VERIFY WEBHOOK CREATED"
44
+ echo "--------------------------"
45
+ result=$(curl -s -X POST http://localhost:8010/mcp \
46
+ -H "Content-Type: application/json" \
47
+ -d '{"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "list_webhooks"}}')
48
+
49
+ if echo "$result" | grep -q "Found.*webhook"; then
50
+ echo "✅ PASSED: Webhook appears in list"
51
+ count=$(echo "$result" | grep -o "ID: ach" | wc -l)
52
+ echo "Total webhooks: $count"
53
+ else
54
+ echo "⚠️ WARNING: No webhooks found"
55
+ fi
56
+ echo ""
57
+
58
+ # Test 4: Get webhook payloads (if webhook exists)
59
+ if [ ! -z "$WEBHOOK_ID" ]; then
60
+ echo "4️⃣ GET WEBHOOK PAYLOADS"
61
+ echo "------------------------"
62
+ result=$(curl -s -X POST http://localhost:8010/mcp \
63
+ -H "Content-Type: application/json" \
64
+ -d "{\"jsonrpc\": \"2.0\", \"id\": 4, \"method\": \"tools/call\", \"params\": {\"name\": \"get_webhook_payloads\", \"arguments\": {\"webhookId\": \"$WEBHOOK_ID\"}}}")
65
+
66
+ if echo "$result" | grep -q "payload\\|No payloads"; then
67
+ echo "✅ PASSED: get_webhook_payloads working"
68
+ else
69
+ echo "❌ FAILED: get_webhook_payloads error"
70
+ fi
71
+
72
+ # Test 5: Refresh webhook
73
+ echo ""
74
+ echo "5️⃣ REFRESH WEBHOOK"
75
+ echo "-------------------"
76
+ result=$(curl -s -X POST http://localhost:8010/mcp \
77
+ -H "Content-Type: application/json" \
78
+ -d "{\"jsonrpc\": \"2.0\", \"id\": 5, \"method\": \"tools/call\", \"params\": {\"name\": \"refresh_webhook\", \"arguments\": {\"webhookId\": \"$WEBHOOK_ID\"}}}")
79
+
80
+ if echo "$result" | grep -q "Successfully refreshed"; then
81
+ echo "✅ PASSED: refresh_webhook working"
82
+ else
83
+ echo "❌ FAILED: refresh_webhook error"
84
+ fi
85
+
86
+ # Test 6: Delete webhook
87
+ echo ""
88
+ echo "6️⃣ DELETE WEBHOOK"
89
+ echo "------------------"
90
+ result=$(curl -s -X POST http://localhost:8010/mcp \
91
+ -H "Content-Type: application/json" \
92
+ -d "{\"jsonrpc\": \"2.0\", \"id\": 6, \"method\": \"tools/call\", \"params\": {\"name\": \"delete_webhook\", \"arguments\": {\"webhookId\": \"$WEBHOOK_ID\"}}}")
93
+
94
+ if echo "$result" | grep -q "Successfully deleted"; then
95
+ echo "✅ PASSED: delete_webhook working"
96
+ else
97
+ echo "❌ FAILED: delete_webhook error"
98
+ echo "$result" | python3 -m json.tool | head -20
99
+ fi
100
+ fi
101
+
102
+ echo ""
103
+ echo "📊 WEBHOOK TEST SUMMARY"
104
+ echo "======================"
105
+ echo "Webhook operations tested with Airtable API"