Introducing Confident Monitor

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.

PUT/v2/tools/{toolId}
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"
    ]
  }
}'
200
{
  "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_KEYstringRequired

    The API key of your Confident AI project.

Path parameters

  • toolIdstringRequired

    The id of the tool.

Request body

  • namestring

    The name of the tool, unique within the project. Omit it to keep the current name.

  • descriptionstring | null

    What the tool does. Send null to clear it, or omit it to keep the current one.

  • modeenum

    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
  • schemaobject

    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. Omit it to keep the current one.

Response

Update Tool succeeded.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    A tool your prompts can call. Changing its mode or schema creates a new version.

    Show 6 propertiesHide 6 properties
    • idstring

      The id of the tool, generated by Confident AI.

    • namestring

      The name of the tool, unique within the project.

    • descriptionstring | null

      What the tool does.

    • modeenum

      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
    • versionstring

      The version of the tool. A pulled prompt returns the version its commit pinned.

    • schemaobject

      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.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI