Skip to main content
POST
/
api
/
v1
/
tools
{
  "id": "unique id",
  "name": "tool name",
  "description": "This is a sample tool for getting temperature.",
  "type": "API_TOOL",
  "userId": "user-id",
  "apiTool": {
    "url": "https://abc.com",
    "method": "GET",
    "body": {
      "title": "{{title}}",
      "content": "{{content}}",
      "userId": "{{userId}}"
    },
    "headers": {
      "Content-type": "application/json",
      "Authorization": "Bearer your-api-token"
    },
    "params": {
      "title": "{{title}}"
    }
  },
  "functionTool": {
    "name": "get_current_temperature",
    "description": "Get the current temperature for a specific location",
    "payload": {
      "type": "object",
      "properties": {
        "location": {
          "type": "string",
          "description": "The city and state, e.g., San Francisco, CA"
        },
        "unit": {
          "type": "string",
          "enum": [
            "Celsius",
            "Fahrenheit"
          ],
          "description": "The temperature unit to use. Infer this from the user's location."
        }
      },
      "required": [
        "location",
        "unit"
      ],
      "additionalProperties": false
    }
  },
  "ajvPropertiesSchema": {},
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

The tool data to create

name
string
required

Name of the tool

Example:

"GET_TEMPERATURE"

description
string
required

Description of the tool

Example:

"This is a sample tool for getting temperature."

type
enum<string>
required

Type of the tool, it can be FUNCTION_TOOL, API_TOOL, KNOWLEDGE_BASE

Available options:
FUNCTION_TOOL,
API_TOOL
Example:

"API_TOOL"

ajvPropertiesSchema
object
required

Parameters of the function in JSON format, This can be changed as per any Json structure

apiTool
object

Tool definition associated with the tool

functionTool
object

Functions associated with the tool

Response

Tool created successfully.

id
string
required

unique id

Example:

"unique id"

name
string
required

Name of the tool

Example:

"tool name"

description
string
required

Description of the tool

Example:

"This is a sample tool for getting temperature."

type
enum<string>
required

Type of the tool, it can be FUNCTION_TOOL, API_TOOL

Available options:
FUNCTION_TOOL,
API_TOOL
Example:

"API_TOOL"

userId
string
required

User creating the tool

Example:

"user-id"

ajvPropertiesSchema
object
required

Parameters of the function in JSON format, This can be changed as per any Json structure

createdAt
string<date-time>
required

Tool created time

updatedAt
string<date-time>
required

Tool updated time

apiTool
object

ApiTool tool

functionTool
object

FunctionTool