Skip to main content
POST
Create a tool

Authorizations

Authorization
string
header
required

Your organization API key (it starts with anek_org_). The same key works on the Voice API and the Support API. See Authentication.

Path Parameters

projectId
string
required

Project id

Body

application/json

Fields not listed here are ignored.

name
string
required

The name the model calls the tool by: a letter, then letters, digits and underscores. Unique among the project-wide tools, or among the agent's private tools.

Minimum string length: 1
Pattern: ^[a-zA-Z][a-zA-Z0-9_]*$
description
string

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

agent_id
string | null

Make the tool private to this agent and attach it to the agent's draft. Leave it out (or null) for a project-wide tool.

type
enum<string>
default:http

http calls your API, knowledgebase searches your organization's knowledge base, code runs your Python code, builtin controls the call (transfer it, collect keypad digits, end it), workflow runs a Clarity workflow, messaging sends a WhatsApp message or an email, handoff moves the conversation to a chat agent.

Available options:
http,
knowledgebase,
code,
builtin,
workflow,
messaging,
handoff,
ticket
configs
http · object

The tool's configuration. Its shape depends on the tool's type, and it is checked against that type; on update without type, against the stored type. builtin takes one of three shapes, by action.

parameters
object | null

JSON Schema (type: object, properties, required) of the arguments the model passes. A knowledgebase tool always takes one query string, whatever you send.

Example:
parameter_mapping
object | null

Renames arguments before the request is built, {argument: request_field}.

hold_message
string | null

What the agent says while the tool runs. Blank or null says nothing.

hold_messages
object | null

The hold message per language of a multilingual agent, keyed by the agent's language label (such as English (US)). A missing language falls back to hold_message.

async_config
object | null

Lets the conversation go on while the tool runs instead of waiting for the result. Not allowed on builtin tools. null turns it off.

session
object | null

The tool's part in the call-scoped caller authentication session. Null means the tool takes no part. A non-null verification makes it a verification tool and carries the verification policy; caller authentication is on for an agent exactly when an attached tool verifies the caller or requires a verified caller. On PATCH, an absent key keeps the stored value and an explicit null clears it.

channels
enum<string>[]

Used only when your organization shares tools between projects through its tool library: which kinds of agents can use this project-wide tool. Ignored otherwise.

Required array length: 1 - 2 elements
Available options:
chat,
voice

Response

The tool was created.

A tool an agent can call during a conversation. Project-wide tools (agent_id: null) can be attached to any agent of the project; a private tool belongs to one agent.

id
string
required

Tool id.

project_id
string
required
agent_id
string | null
required

The agent the tool is private to, or null for a project-wide tool.

name
string
required

The name the model calls the tool by.

description
string
required

What the tool does and when to use it, as the model reads it.

type
string
required

What the tool does, which decides the shape of configs: http, knowledgebase, code, builtin, workflow, messaging, handoff or ticket.

configs
object
required

The tool's configuration, in the shape of its type (see configs in Create a tool). It can also carry values Clarity fills in on save, such as a workflow's url or a knowledge base's search target.

parameters
object
required

JSON Schema of the arguments the model passes when it calls the tool.

parameter_mapping
object | null
required

Renames arguments before the request is built, {argument: request_field}. null when none.

hold_message
string | null
required

What the agent says while the tool runs, or null for nothing.

hold_messages
object | null
required

The hold message per language of a multilingual agent, keyed by language label.

async_config
object | null
required

Settings that let the conversation go on while the tool runs, in the shape of async_config in Create a tool. null means the agent waits for the result.

session
object | null
required

The tool's part in the call-scoped caller authentication session. Null means the tool takes no part. A non-null verification makes it a verification tool and carries the verification policy; caller authentication is on for an agent exactly when an attached tool verifies the caller or requires a verified caller. On PATCH, an absent key keeps the stored value and an explicit null clears it.

updated_at
integer<int64> | null
required

When the tool was last changed, in milliseconds since the Unix epoch. null for a tool not changed since this field was added.

library_tool_id
string | null

The organization tool library entry this tool comes from, or null for a tool that belongs to this project only.

library_revision
integer | null

The library entry's revision this tool holds, or null.

library_channels
string[] | null

Which kinds of agents (chat, voice) can use the library entry, or null.

used_by_count
integer

How many agents of the project have the tool attached. A published agent keeps calling the tool it was published with until it is published again, whatever this count says. Present on reads and lists.

used_by_agents
object[]

The agents the tool is attached to. Returned when you get one tool, not in lists.