Create Tool
(v2)POST
Creates a tool in your Confident AI project and returns its id. Names are unique within a project; reusing one returns a 409.
curl -X POST "https://api.confident-ai.com/v2/tools" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "get_customer_name",
"description": "Looks up the customer'\''s name by id.",
"mode": "ALLOW_ADDITIONAL",
"schema": {
"type": "object",
"properties": {
"customerId": {
"type": "string",
"description": "The id of the customer to look up."
},
"nameFormat": {
"type": "string",
"enum": [
"FULL",
"FIRST"
],
"description": "Whether to return the full name or only the first name."
}
},
"required": [
"customerId"
]
}
}'{
"success": true,
"data": {
"id": "<TOOL-ID>"
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Request body
namestringRequiredThe name of the tool, unique within the project. The model calls the tool by this name.
descriptionstring | nullWhat the tool does. The model reads it to decide when to call the tool.
modeenumRequiredThis is the mode for your tool input fields, which controls whether fields outside the schema are allowed.
Show 3 enum valuesHide 3 enum values
ALLOW_ADDITIONALNO_ADDITIONALSTRICT
schemaobjectRequiredThe JSON Schema for the tool's input. List each parameter under
propertieswith atype, and name the mandatory ones inrequired. A parameter can also have adescription, anenumof allowed values, oritemsfor an array. Whether extra properties are allowed is set bymode.
Response
Create Tool succeeded.
successbooleanIndicates if the request was successful.
dataobjectA reference to a tool by its id.
Show 1 propertyHide 1 property
idstringThe id of the tool, generated by Confident AI.
deprecatedbooleanIndicates if this endpoint is deprecated.