Skip to main content
POST
/
workflows
/
v1
/
tools
Create Tool
curl --request POST \
  --url https://api-qa.interactly.ai/workflows/v1/tools \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "logical_id": "<string>",
  "tool_id": "<string>",
  "name": "<string>",
  "description": "<string>",
  "category": "<string>",
  "signature": "<string>",
  "args_schema": {},
  "static_messages_config": {
    "static_messages": [
      "<string>"
    ],
    "static_messages_selection_mode": "random"
  },
  "result_runtime_variable_name": "tool_result",
  "type": "inline_python",
  "code": "<string>"
}
'
{
  "tool": {
    "team_id": "<string>",
    "created_by": "<string>",
    "updated_by": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "_id": "5eb7cf5a86d9755df3a6c593",
    "tool_config": {
      "logical_id": "<string>",
      "tool_id": "<string>",
      "name": "<string>",
      "description": "<string>",
      "category": "<string>",
      "signature": "<string>",
      "args_schema": {},
      "static_messages_config": {
        "static_messages": [
          "<string>"
        ],
        "static_messages_selection_mode": "random"
      },
      "result_runtime_variable_name": "tool_result",
      "type": "inline_python",
      "code": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

Retrieve your API Key from Dashboard API Keys Section.

Body

application/json

Configuration for an inline Python tool. The "code" field should contain a self-contained executable Python function. Example value of "code" string could be: def add( a: float, b: float, ) -> float: return float(a + b)

logical_id
string | null

Unique identifier for the tool

tool_id
string | null

Reference to the tool already created in the Workflow System. If not provided, the tool config is assumed to be provided inline here.

name
string | null

Name for the tool

description
string | null

Human friendly description for the tool (not used by AI)

category
string | null

Category for the tool. E.g math, ehr, etc

signature
string | null

Docstring or signature for the tool used by AI. If provided and there is a default signature already, it will override the default signature.

args_schema
Tool Arguments Schema · object

Schema for the arguments that the tool accepts. This should be a JSON schema dictionary. Information provided here will override any default arguments schema.

static_messages_config
StaticMessagesConfig · object

Static messages that an LLM node should emit while this tool is being invoked

result_runtime_variable_name
string | null
default:tool_result

Name of the runtime variable to store the result from this tool call

type
string
default:inline_python

Type of the tool. Must be 'inline_python'

Allowed value: "inline_python"
code
string | null

Python code to be executed by the tool. It should define a function with proper signature and descriptions for its parameters.

Response

Successful Response

Response model for a single tool. Contains a ToolsModel object.

tool
ToolsModel · object
required

Single tool object