Overview

The delete_tool function permanently deletes an AI tool from the system.

Function Signature

pub async fn delete_tool(tool_id: &str) -> Result<()>

Parameters

tool_id
&str
required
The unique identifier of the tool to delete

Return Value

Returns Result<()> indicating success or failure.

Basic Usage

use wacht::api::tools::*;

delete_tool("52057194421551105").await?;
println!("Tool deleted successfully");

Error Handling

match delete_tool("52057194421551105").await {
    Ok(()) => {
        println!("Tool deleted successfully");
    }
    Err(Error::Api { status, message, .. }) => {
        match status.as_u16() {
            404 => println!("Tool not found"),
            403 => println!("Access denied: {}", message),
            409 => println!("Cannot delete tool in use: {}", message),
            _ => println!("API error {}: {}", status, message),
        }
    }
    Err(e) => println!("Request failed: {}", e),
}

Important Notes

  • This operation is irreversible
  • Tools currently in use by agents or workflows cannot be deleted
  • You must have appropriate permissions to delete tools

Rate Limits

  • Delete operations: 20 requests per minute
  • Burst limit: 5 requests per second