Creating Custom Tools
Create a Custom Tool in the Dify Console
-
Navigate to the Dify console and select "Create Custom Tool".
-
Add a Name and Schema for the tool.
Name: movie Schema Content:
The content of the schema is as follows, Replace
{
"openapi": "3.1.0",
"info": {
"title": "Movie Assistant",
"description": "Retrieve movie information from the local movie database",
"version": "v1.0.0"
},
"servers": [
{
"url": "http://<Public IP>:8888"
}
],
"paths": {
"/new-api-for-dify": {
"get": {
"description": "Retrieve movie information based on keywords",
"operationId": "GetMoviesByKeyword",
"parameters": [
{
"name": "keyword",
"in": "query",
"description": "Keywords to search for",
"required": true,
"schema": {
"type": "string"
}
}
],
"deprecated": false
}
}
},
"components": {
"schemas": {}
}
}
Click "Test", enter any value (in English) to test.
Verify and save to complete the process. With this, we have successfully created a custom tool that can be called by Dify.
In the next step, we will build an AI Agent by combining this custom tool.