-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathapi-test.sh
More file actions
executable file
·68 lines (58 loc) · 1.86 KB
/
api-test.sh
File metadata and controls
executable file
·68 lines (58 loc) · 1.86 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# Daiso MCP API 테스트 스크립트
# 사용법: ./api-test.sh [API_URL]
# 예시: ./api-test.sh http://localhost:8787
# ./api-test.sh https://your-worker.workers.dev
API_URL=${1:-"http://localhost:8787"}
echo "================================"
echo "Daiso MCP API 테스트"
echo "API URL: $API_URL"
echo "================================"
echo ""
# 1. 서버 정보 조회
echo "1. 서버 정보 조회"
echo "GET $API_URL/"
curl -s "$API_URL/" | jq '.'
echo ""
echo ""
# 2. 도구 목록 조회
echo "2. 도구 목록 조회"
echo "GET $API_URL/tools"
curl -s "$API_URL/tools" | jq '.tools[] | {name, description}'
echo ""
echo ""
# 3. 제품 검색
echo "3. 제품 검색 - '수납박스' 검색"
echo "POST $API_URL/execute"
curl -s -X POST "$API_URL/execute" \
-H "Content-Type: application/json" \
-d '{"name":"search_products","arguments":{"query":"수납박스"}}' | jq '.'
echo ""
echo ""
# 4. 매장 찾기
echo "4. 매장 찾기 - 서울 시청 근처"
echo "POST $API_URL/execute"
curl -s -X POST "$API_URL/execute" \
-H "Content-Type: application/json" \
-d '{"name":"find_stores","arguments":{"latitude":37.5665,"longitude":126.9780,"radius":5}}' | jq '.'
echo ""
echo ""
# 5. 재고 확인
echo "5. 재고 확인 - 강남점(S001)의 수납박스(P001)"
echo "POST $API_URL/execute"
curl -s -X POST "$API_URL/execute" \
-H "Content-Type: application/json" \
-d '{"name":"check_inventory","arguments":{"storeId":"S001","productId":"P001"}}' | jq '.'
echo ""
echo ""
# 6. 가격 정보 조회
echo "6. 가격 정보 조회 - 볼펜 10입(P002)"
echo "POST $API_URL/execute"
curl -s -X POST "$API_URL/execute" \
-H "Content-Type: application/json" \
-d '{"name":"get_price_info","arguments":{"productId":"P002"}}' | jq '.'
echo ""
echo ""
echo "================================"
echo "테스트 완료!"
echo "================================"