Introducing Confident Monitor

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.

POST/v2/tools
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"
    ]
  }
}'
200
{
  "success": true,
  "data": {
    "id": "<TOOL-ID>"
  },
  "deprecated": false
}

Headers

  • CONFIDENT_API_KEYstringRequired

    The API key of your Confident AI project.

Request body

  • namestringRequired

    The name of the tool, unique within the project. The model calls the tool by this name.

  • descriptionstring | null

    What the tool does. The model reads it to decide when to call the tool.

  • modeenumRequired

    This 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_ADDITIONAL
    • NO_ADDITIONAL
    • STRICT
  • schemaobjectRequired

    The JSON Schema for the tool's input. List each parameter under properties with a type, and name the mandatory ones in required. A parameter can also have a description, an enum of allowed values, or items for an array. Whether extra properties are allowed is set by mode.

Response

Create Tool succeeded.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    A reference to a tool by its id.

    Show 1 propertyHide 1 property
    • idstring

      The id of the tool, generated by Confident AI.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI