-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-workflow-curl.sh
More file actions
executable file
·44 lines (40 loc) · 1.4 KB
/
test-workflow-curl.sh
File metadata and controls
executable file
·44 lines (40 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
echo "Testing MCP Server Workflow with curl..."
echo
# Test workflow-based trend line command
echo "Testing trend line command (should use Workflow and generate add_trend_line)..."
echo
curl -X POST http://127.0.0.1:5001/spotcanvas-prod/us-central1/mcpServer/chat \
-H "Content-Type: application/json" \
-d '{
"message": "Draw a resistance trend line through the highest points",
"userId": "test-user-workflow",
"sessionId": "test-session-curl",
"chartContext": {
"symbol": "BTC-USD",
"granularity": "ONE_HOUR",
"timeRange": {
"start": 1700000000000,
"end": 1700604800000
},
"priceRange": {
"min": 40000,
"max": 50000
}
}
}' \
--no-buffer 2>/dev/null | while IFS= read -r line; do
if [[ $line == data:* ]]; then
# Extract JSON from SSE data
json="${line#data: }"
if [[ -n "$json" && "$json" != " " ]]; then
# Parse and display the JSON
echo "$json" | jq -r 'if .type == "content" then .content elif .type == "tool_call" then "📌 Tool Call: \(.tool) (ID: \(.commandId))" elif .type == "done" then "✅ Complete" else . end' 2>/dev/null || echo "$json"
fi
fi
done
echo
echo "Check Firestore at http://127.0.0.1:4000/firestore"
echo "Look for: users/test-user-workflow/chart_commands"
echo
echo "The command should be 'add_trend_line' with proper start/end structure"