Creating Custom Tools

Create a Custom Tool in the Dify Console

  1. Navigate to the Dify console and select "Create Custom Tool". Create Custom Tool

  2. Add a Name and Schema for the tool. Add schema

Name: movie Schema Content:

The content of the schema is as follows, Replace with the Public IP of your Dify instance and use port 8888.

{
  "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. Test custom tool

Verify and save to complete the process. With this, we have successfully created a custom tool that can be called by Dify. Movie assistant

In the next step, we will build an AI Agent by combining this custom tool.