Update Tool
(v2)PUT
Updates a tool and returns it at its latest version. A changed mode or schema creates a new version, and prompt commits keep the version they pinned. Names are unique within a project; taking another tool's name returns a 409.
curl -X PUT "https://api.confident-ai.com/v2/tools/{toolId}" \
-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>",
"name": "get_customer_name",
"description": "Looks up the customer's name by id.",
"mode": "ALLOW_ADDITIONAL",
"version": "00.00.01",
"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"
]
}
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
toolIdstringRequiredThe id of the tool.
Request body
namestringThe name of the tool, unique within the project. Omit it to keep the current name.
descriptionstring | nullWhat the tool does. Send
nullto clear it, or omit it to keep the current one.modeenumThis 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
schemaobjectThe 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. Omit it to keep the current one.
Response
Update Tool succeeded.
successbooleanIndicates if the request was successful.
dataobjectA tool your prompts can call. Changing its
modeorschemacreates a new version.Show 6 propertiesHide 6 properties
idstringThe id of the tool, generated by Confident AI.
namestringThe name of the tool, unique within the project.
descriptionstring | nullWhat the tool does.
modeenumThis 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
versionstringThe version of the tool. A pulled prompt returns the version its commit pinned.
schemaobjectThe 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.
deprecatedbooleanIndicates if this endpoint is deprecated.