Mevcut bir aracı güncelleyin
/api/v1/tools/:toolIdMevcut bir aracın adını, açıklamasını veya konfigürasyonunu günceller.
toolIdstring (gerekli)Güncellenecek aracın ID'si
Tüm parametreler opsiyoneldir. Sadece güncellemek istediğiniz alanları gönderin.
namestringAracın yeni adı
descriptionstringAracın yeni açıklaması
configobjectGüncellenmiş konfigürasyon (mevcut config ile birleştirilir)
curl -X PUT https://api.wespoke.ai/api/v1/tools/tool_abc123 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "CRM Query (Updated)"
}'curl -X PUT https://api.wespoke.ai/api/v1/tools/tool_abc123 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"config": {
"query": {
"expand": "details,segments"
}
}
}'curl -X PUT https://api.wespoke.ai/api/v1/tools/tool_abc123 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "CRM Customer Query",
"description": "Fetches detailed customer info from CRM API",
"config": {
"url": "https://api.crm.local/v2/customers/{id}",
"query": {
"expand": "details,segments,history"
}
}
}'{
"success": true,
"data": {
"id": "tool_abc123",
"name": "CRM Customer Query",
"type": "API_REQUEST",
"description": "Fetches detailed customer info from CRM API",
"config": {
"url": "https://api.crm.local/v2/customers/{id}",
"method": "GET",
"headers": {
"Authorization": "Bearer {{secrets.CRM_API_KEY}}"
},
"query": {
"expand": "details,segments,history"
}
},
"createdAt": "2024-01-14T09:00:00Z",
"updatedAt": "2024-01-16T14:30:00Z"
}
}• Araç tipi (type) güncellenemez. Farklı bir tip kullanmak için yeni araç oluşturun.
• Config objesi mevcut konfigürasyon ile birleştirilir (deep merge).
• Belirli bir config alanını silmek için null değeri gönderin.
• Güncellenmiş araç kullanan asistanlar otomatik olarak yeni konfigürasyonu kullanır.
{
"success": false,
"error": {
"code": "TOOL_NOT_FOUND",
"message": "Tool not found"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid update",
"details": {
"config.url": "Invalid URL format"
}
}
}