Create Agent Tool
Add a tool instance to an agent.
Multiple instances of the same tool_key are allowed as long as their
instance_name differs. The instance_name is the function name the LLM
will use when calling the tool, so it must be unique per agent and a
valid identifier (letters/digits/underscore/hyphen).
curl --request POST \
--url https://api.example.com/agents/{agent_id}/tools \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tool_key": "<string>",
"instance_name": "<string>",
"display_name": "<string>",
"enabled": true,
"config": {
"description": "<string>",
"disallow_interruptions": true,
"requires_caller_consent": true,
"cost_unit": "<string>",
"goodbye_instructions": "<string>",
"goodbye_max_duration_ms": 10250,
"delete_room": true,
"wait_for_playout": true,
"record_end_reason": true,
"default_inter_digit_ms": 1000,
"inter_digit_ms": 1000,
"default_duration_ms": 1020,
"default_volume": 50,
"ivr_detection": true,
"allowed_digits": "<string>",
"max_sequence_length": 64,
"sip_trunk_id": "<string>",
"sip_trunk_address": "<string>",
"sip_headers": {},
"hold_audio_url": "<string>",
"hold_audio_loop": true,
"transfer_briefing_prompt": "<string>",
"transfer_briefing_voice_id": "<string>",
"transfer_announcement_prompt": "<string>",
"transfer_announcement": "<string>",
"transfer_timeout_s": 150,
"transfer_max_attempts": 5,
"fallback_target_name": "<string>",
"take_message_on_failure": true,
"target_directory": [
"<string>"
],
"target_number": "<string>",
"targets": [
{}
],
"play_dialtone": true,
"cold_transfer_announcement_prompt": "<string>",
"specialists": [
{}
],
"prefer_warm": true,
"handoff_announcement_prompt": "<string>",
"preserve_chat_ctx": true,
"chat_ctx_token_cap": 32128,
"service_account_email": "<string>",
"oauth_refresh_token_ref": "<string>",
"default_spreadsheet_id": "<string>",
"allowed_spreadsheet_ids": [
"<string>"
],
"max_rows_per_read": 5000,
"max_rows_per_write": 2500,
"result_summarization": true,
"spreadsheet_id": "<string>",
"sheet_name": "<string>",
"credentials_json": {},
"column_mapping": {},
"data_source_url": "<string>",
"auth_secret_ref": "<string>",
"query_template": "<string>",
"allowed_filters": [
"<string>"
],
"default_limit": 250,
"max_limit": 500,
"pii_redaction": true,
"cache_ttl_s": 43200,
"top_k_default": 10,
"similarity_threshold": 0.5,
"knowledge_namespace": "<string>",
"account_sid_ref": "<string>",
"auth_token_ref": "<string>",
"from_e164": "<string>",
"default_from": "<string>",
"allowed_destination_country_codes": [
"<string>"
],
"allow_send_to_caller_only": true,
"max_message_length": 1000,
"template_id": "<string>",
"template": "<string>",
"daily_quota_per_number": 500,
"require_explicit_consent": true,
"url": "<string>",
"url_allowlist": [
"<string>"
],
"allowed_methods": [
"<string>"
],
"default_headers": {},
"method": "<string>",
"headers": {},
"auth": {
"type": "none",
"token": "<string>",
"username": "<string>",
"password": "<string>",
"api_key_header": "X-API-Key",
"api_key_value": "<string>"
},
"signing_secret_ref": "<string>",
"timeout_s": 60,
"timeout_seconds": 60,
"max_retries": 5,
"max_body_bytes": 5000064,
"redact_response_pii": true,
"body_template": "<string>",
"retry_policy": {},
"simulate_latency_ms": 15000,
"simulate_error_rate": 0.5,
"expected_inputs": {},
"canned_response": "<string>",
"response_template": "<string>",
"latency_ms": 15000,
"handler_ref": "<string>",
"raw_schema": {},
"parameters_schema": {},
"execution_endpoint": "<string>",
"python_code": "<string>",
"rpc_method": "<string>",
"mcp_url": "<string>",
"mcp_allowlist": [
"<string>"
],
"bearer_token": "<string>",
"extra_headers": {},
"is_end_call": true,
"is_transfer": true,
"webhook_url": "<string>",
"auth_config": {}
},
"tool_type": "function",
"description": "<string>"
}
'import requests
url = "https://api.example.com/agents/{agent_id}/tools"
payload = {
"tool_key": "<string>",
"instance_name": "<string>",
"display_name": "<string>",
"enabled": True,
"config": {
"description": "<string>",
"disallow_interruptions": True,
"requires_caller_consent": True,
"cost_unit": "<string>",
"goodbye_instructions": "<string>",
"goodbye_max_duration_ms": 10250,
"delete_room": True,
"wait_for_playout": True,
"record_end_reason": True,
"default_inter_digit_ms": 1000,
"inter_digit_ms": 1000,
"default_duration_ms": 1020,
"default_volume": 50,
"ivr_detection": True,
"allowed_digits": "<string>",
"max_sequence_length": 64,
"sip_trunk_id": "<string>",
"sip_trunk_address": "<string>",
"sip_headers": {},
"hold_audio_url": "<string>",
"hold_audio_loop": True,
"transfer_briefing_prompt": "<string>",
"transfer_briefing_voice_id": "<string>",
"transfer_announcement_prompt": "<string>",
"transfer_announcement": "<string>",
"transfer_timeout_s": 150,
"transfer_max_attempts": 5,
"fallback_target_name": "<string>",
"take_message_on_failure": True,
"target_directory": ["<string>"],
"target_number": "<string>",
"targets": [{}],
"play_dialtone": True,
"cold_transfer_announcement_prompt": "<string>",
"specialists": [{}],
"prefer_warm": True,
"handoff_announcement_prompt": "<string>",
"preserve_chat_ctx": True,
"chat_ctx_token_cap": 32128,
"service_account_email": "<string>",
"oauth_refresh_token_ref": "<string>",
"default_spreadsheet_id": "<string>",
"allowed_spreadsheet_ids": ["<string>"],
"max_rows_per_read": 5000,
"max_rows_per_write": 2500,
"result_summarization": True,
"spreadsheet_id": "<string>",
"sheet_name": "<string>",
"credentials_json": {},
"column_mapping": {},
"data_source_url": "<string>",
"auth_secret_ref": "<string>",
"query_template": "<string>",
"allowed_filters": ["<string>"],
"default_limit": 250,
"max_limit": 500,
"pii_redaction": True,
"cache_ttl_s": 43200,
"top_k_default": 10,
"similarity_threshold": 0.5,
"knowledge_namespace": "<string>",
"account_sid_ref": "<string>",
"auth_token_ref": "<string>",
"from_e164": "<string>",
"default_from": "<string>",
"allowed_destination_country_codes": ["<string>"],
"allow_send_to_caller_only": True,
"max_message_length": 1000,
"template_id": "<string>",
"template": "<string>",
"daily_quota_per_number": 500,
"require_explicit_consent": True,
"url": "<string>",
"url_allowlist": ["<string>"],
"allowed_methods": ["<string>"],
"default_headers": {},
"method": "<string>",
"headers": {},
"auth": {
"type": "none",
"token": "<string>",
"username": "<string>",
"password": "<string>",
"api_key_header": "X-API-Key",
"api_key_value": "<string>"
},
"signing_secret_ref": "<string>",
"timeout_s": 60,
"timeout_seconds": 60,
"max_retries": 5,
"max_body_bytes": 5000064,
"redact_response_pii": True,
"body_template": "<string>",
"retry_policy": {},
"simulate_latency_ms": 15000,
"simulate_error_rate": 0.5,
"expected_inputs": {},
"canned_response": "<string>",
"response_template": "<string>",
"latency_ms": 15000,
"handler_ref": "<string>",
"raw_schema": {},
"parameters_schema": {},
"execution_endpoint": "<string>",
"python_code": "<string>",
"rpc_method": "<string>",
"mcp_url": "<string>",
"mcp_allowlist": ["<string>"],
"bearer_token": "<string>",
"extra_headers": {},
"is_end_call": True,
"is_transfer": True,
"webhook_url": "<string>",
"auth_config": {}
},
"tool_type": "function",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tool_key: '<string>',
instance_name: '<string>',
display_name: '<string>',
enabled: true,
config: {
description: '<string>',
disallow_interruptions: true,
requires_caller_consent: true,
cost_unit: '<string>',
goodbye_instructions: '<string>',
goodbye_max_duration_ms: 10250,
delete_room: true,
wait_for_playout: true,
record_end_reason: true,
default_inter_digit_ms: 1000,
inter_digit_ms: 1000,
default_duration_ms: 1020,
default_volume: 50,
ivr_detection: true,
allowed_digits: '<string>',
max_sequence_length: 64,
sip_trunk_id: '<string>',
sip_trunk_address: '<string>',
sip_headers: {},
hold_audio_url: '<string>',
hold_audio_loop: true,
transfer_briefing_prompt: '<string>',
transfer_briefing_voice_id: '<string>',
transfer_announcement_prompt: '<string>',
transfer_announcement: '<string>',
transfer_timeout_s: 150,
transfer_max_attempts: 5,
fallback_target_name: '<string>',
take_message_on_failure: true,
target_directory: ['<string>'],
target_number: '<string>',
targets: [{}],
play_dialtone: true,
cold_transfer_announcement_prompt: '<string>',
specialists: [{}],
prefer_warm: true,
handoff_announcement_prompt: '<string>',
preserve_chat_ctx: true,
chat_ctx_token_cap: 32128,
service_account_email: '<string>',
oauth_refresh_token_ref: '<string>',
default_spreadsheet_id: '<string>',
allowed_spreadsheet_ids: ['<string>'],
max_rows_per_read: 5000,
max_rows_per_write: 2500,
result_summarization: true,
spreadsheet_id: '<string>',
sheet_name: '<string>',
credentials_json: {},
column_mapping: {},
data_source_url: '<string>',
auth_secret_ref: '<string>',
query_template: '<string>',
allowed_filters: ['<string>'],
default_limit: 250,
max_limit: 500,
pii_redaction: true,
cache_ttl_s: 43200,
top_k_default: 10,
similarity_threshold: 0.5,
knowledge_namespace: '<string>',
account_sid_ref: '<string>',
auth_token_ref: '<string>',
from_e164: '<string>',
default_from: '<string>',
allowed_destination_country_codes: ['<string>'],
allow_send_to_caller_only: true,
max_message_length: 1000,
template_id: '<string>',
template: '<string>',
daily_quota_per_number: 500,
require_explicit_consent: true,
url: '<string>',
url_allowlist: ['<string>'],
allowed_methods: ['<string>'],
default_headers: {},
method: '<string>',
headers: {},
auth: {
type: 'none',
token: '<string>',
username: '<string>',
password: '<string>',
api_key_header: 'X-API-Key',
api_key_value: '<string>'
},
signing_secret_ref: '<string>',
timeout_s: 60,
timeout_seconds: 60,
max_retries: 5,
max_body_bytes: 5000064,
redact_response_pii: true,
body_template: '<string>',
retry_policy: {},
simulate_latency_ms: 15000,
simulate_error_rate: 0.5,
expected_inputs: {},
canned_response: '<string>',
response_template: '<string>',
latency_ms: 15000,
handler_ref: '<string>',
raw_schema: {},
parameters_schema: {},
execution_endpoint: '<string>',
python_code: '<string>',
rpc_method: '<string>',
mcp_url: '<string>',
mcp_allowlist: ['<string>'],
bearer_token: '<string>',
extra_headers: {},
is_end_call: true,
is_transfer: true,
webhook_url: '<string>',
auth_config: {}
},
tool_type: 'function',
description: '<string>'
})
};
fetch('https://api.example.com/agents/{agent_id}/tools', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/agents/{agent_id}/tools",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tool_key' => '<string>',
'instance_name' => '<string>',
'display_name' => '<string>',
'enabled' => true,
'config' => [
'description' => '<string>',
'disallow_interruptions' => true,
'requires_caller_consent' => true,
'cost_unit' => '<string>',
'goodbye_instructions' => '<string>',
'goodbye_max_duration_ms' => 10250,
'delete_room' => true,
'wait_for_playout' => true,
'record_end_reason' => true,
'default_inter_digit_ms' => 1000,
'inter_digit_ms' => 1000,
'default_duration_ms' => 1020,
'default_volume' => 50,
'ivr_detection' => true,
'allowed_digits' => '<string>',
'max_sequence_length' => 64,
'sip_trunk_id' => '<string>',
'sip_trunk_address' => '<string>',
'sip_headers' => [
],
'hold_audio_url' => '<string>',
'hold_audio_loop' => true,
'transfer_briefing_prompt' => '<string>',
'transfer_briefing_voice_id' => '<string>',
'transfer_announcement_prompt' => '<string>',
'transfer_announcement' => '<string>',
'transfer_timeout_s' => 150,
'transfer_max_attempts' => 5,
'fallback_target_name' => '<string>',
'take_message_on_failure' => true,
'target_directory' => [
'<string>'
],
'target_number' => '<string>',
'targets' => [
[
]
],
'play_dialtone' => true,
'cold_transfer_announcement_prompt' => '<string>',
'specialists' => [
[
]
],
'prefer_warm' => true,
'handoff_announcement_prompt' => '<string>',
'preserve_chat_ctx' => true,
'chat_ctx_token_cap' => 32128,
'service_account_email' => '<string>',
'oauth_refresh_token_ref' => '<string>',
'default_spreadsheet_id' => '<string>',
'allowed_spreadsheet_ids' => [
'<string>'
],
'max_rows_per_read' => 5000,
'max_rows_per_write' => 2500,
'result_summarization' => true,
'spreadsheet_id' => '<string>',
'sheet_name' => '<string>',
'credentials_json' => [
],
'column_mapping' => [
],
'data_source_url' => '<string>',
'auth_secret_ref' => '<string>',
'query_template' => '<string>',
'allowed_filters' => [
'<string>'
],
'default_limit' => 250,
'max_limit' => 500,
'pii_redaction' => true,
'cache_ttl_s' => 43200,
'top_k_default' => 10,
'similarity_threshold' => 0.5,
'knowledge_namespace' => '<string>',
'account_sid_ref' => '<string>',
'auth_token_ref' => '<string>',
'from_e164' => '<string>',
'default_from' => '<string>',
'allowed_destination_country_codes' => [
'<string>'
],
'allow_send_to_caller_only' => true,
'max_message_length' => 1000,
'template_id' => '<string>',
'template' => '<string>',
'daily_quota_per_number' => 500,
'require_explicit_consent' => true,
'url' => '<string>',
'url_allowlist' => [
'<string>'
],
'allowed_methods' => [
'<string>'
],
'default_headers' => [
],
'method' => '<string>',
'headers' => [
],
'auth' => [
'type' => 'none',
'token' => '<string>',
'username' => '<string>',
'password' => '<string>',
'api_key_header' => 'X-API-Key',
'api_key_value' => '<string>'
],
'signing_secret_ref' => '<string>',
'timeout_s' => 60,
'timeout_seconds' => 60,
'max_retries' => 5,
'max_body_bytes' => 5000064,
'redact_response_pii' => true,
'body_template' => '<string>',
'retry_policy' => [
],
'simulate_latency_ms' => 15000,
'simulate_error_rate' => 0.5,
'expected_inputs' => [
],
'canned_response' => '<string>',
'response_template' => '<string>',
'latency_ms' => 15000,
'handler_ref' => '<string>',
'raw_schema' => [
],
'parameters_schema' => [
],
'execution_endpoint' => '<string>',
'python_code' => '<string>',
'rpc_method' => '<string>',
'mcp_url' => '<string>',
'mcp_allowlist' => [
'<string>'
],
'bearer_token' => '<string>',
'extra_headers' => [
],
'is_end_call' => true,
'is_transfer' => true,
'webhook_url' => '<string>',
'auth_config' => [
]
],
'tool_type' => 'function',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/agents/{agent_id}/tools"
payload := strings.NewReader("{\n \"tool_key\": \"<string>\",\n \"instance_name\": \"<string>\",\n \"display_name\": \"<string>\",\n \"enabled\": true,\n \"config\": {\n \"description\": \"<string>\",\n \"disallow_interruptions\": true,\n \"requires_caller_consent\": true,\n \"cost_unit\": \"<string>\",\n \"goodbye_instructions\": \"<string>\",\n \"goodbye_max_duration_ms\": 10250,\n \"delete_room\": true,\n \"wait_for_playout\": true,\n \"record_end_reason\": true,\n \"default_inter_digit_ms\": 1000,\n \"inter_digit_ms\": 1000,\n \"default_duration_ms\": 1020,\n \"default_volume\": 50,\n \"ivr_detection\": true,\n \"allowed_digits\": \"<string>\",\n \"max_sequence_length\": 64,\n \"sip_trunk_id\": \"<string>\",\n \"sip_trunk_address\": \"<string>\",\n \"sip_headers\": {},\n \"hold_audio_url\": \"<string>\",\n \"hold_audio_loop\": true,\n \"transfer_briefing_prompt\": \"<string>\",\n \"transfer_briefing_voice_id\": \"<string>\",\n \"transfer_announcement_prompt\": \"<string>\",\n \"transfer_announcement\": \"<string>\",\n \"transfer_timeout_s\": 150,\n \"transfer_max_attempts\": 5,\n \"fallback_target_name\": \"<string>\",\n \"take_message_on_failure\": true,\n \"target_directory\": [\n \"<string>\"\n ],\n \"target_number\": \"<string>\",\n \"targets\": [\n {}\n ],\n \"play_dialtone\": true,\n \"cold_transfer_announcement_prompt\": \"<string>\",\n \"specialists\": [\n {}\n ],\n \"prefer_warm\": true,\n \"handoff_announcement_prompt\": \"<string>\",\n \"preserve_chat_ctx\": true,\n \"chat_ctx_token_cap\": 32128,\n \"service_account_email\": \"<string>\",\n \"oauth_refresh_token_ref\": \"<string>\",\n \"default_spreadsheet_id\": \"<string>\",\n \"allowed_spreadsheet_ids\": [\n \"<string>\"\n ],\n \"max_rows_per_read\": 5000,\n \"max_rows_per_write\": 2500,\n \"result_summarization\": true,\n \"spreadsheet_id\": \"<string>\",\n \"sheet_name\": \"<string>\",\n \"credentials_json\": {},\n \"column_mapping\": {},\n \"data_source_url\": \"<string>\",\n \"auth_secret_ref\": \"<string>\",\n \"query_template\": \"<string>\",\n \"allowed_filters\": [\n \"<string>\"\n ],\n \"default_limit\": 250,\n \"max_limit\": 500,\n \"pii_redaction\": true,\n \"cache_ttl_s\": 43200,\n \"top_k_default\": 10,\n \"similarity_threshold\": 0.5,\n \"knowledge_namespace\": \"<string>\",\n \"account_sid_ref\": \"<string>\",\n \"auth_token_ref\": \"<string>\",\n \"from_e164\": \"<string>\",\n \"default_from\": \"<string>\",\n \"allowed_destination_country_codes\": [\n \"<string>\"\n ],\n \"allow_send_to_caller_only\": true,\n \"max_message_length\": 1000,\n \"template_id\": \"<string>\",\n \"template\": \"<string>\",\n \"daily_quota_per_number\": 500,\n \"require_explicit_consent\": true,\n \"url\": \"<string>\",\n \"url_allowlist\": [\n \"<string>\"\n ],\n \"allowed_methods\": [\n \"<string>\"\n ],\n \"default_headers\": {},\n \"method\": \"<string>\",\n \"headers\": {},\n \"auth\": {\n \"type\": \"none\",\n \"token\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"api_key_header\": \"X-API-Key\",\n \"api_key_value\": \"<string>\"\n },\n \"signing_secret_ref\": \"<string>\",\n \"timeout_s\": 60,\n \"timeout_seconds\": 60,\n \"max_retries\": 5,\n \"max_body_bytes\": 5000064,\n \"redact_response_pii\": true,\n \"body_template\": \"<string>\",\n \"retry_policy\": {},\n \"simulate_latency_ms\": 15000,\n \"simulate_error_rate\": 0.5,\n \"expected_inputs\": {},\n \"canned_response\": \"<string>\",\n \"response_template\": \"<string>\",\n \"latency_ms\": 15000,\n \"handler_ref\": \"<string>\",\n \"raw_schema\": {},\n \"parameters_schema\": {},\n \"execution_endpoint\": \"<string>\",\n \"python_code\": \"<string>\",\n \"rpc_method\": \"<string>\",\n \"mcp_url\": \"<string>\",\n \"mcp_allowlist\": [\n \"<string>\"\n ],\n \"bearer_token\": \"<string>\",\n \"extra_headers\": {},\n \"is_end_call\": true,\n \"is_transfer\": true,\n \"webhook_url\": \"<string>\",\n \"auth_config\": {}\n },\n \"tool_type\": \"function\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/agents/{agent_id}/tools")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tool_key\": \"<string>\",\n \"instance_name\": \"<string>\",\n \"display_name\": \"<string>\",\n \"enabled\": true,\n \"config\": {\n \"description\": \"<string>\",\n \"disallow_interruptions\": true,\n \"requires_caller_consent\": true,\n \"cost_unit\": \"<string>\",\n \"goodbye_instructions\": \"<string>\",\n \"goodbye_max_duration_ms\": 10250,\n \"delete_room\": true,\n \"wait_for_playout\": true,\n \"record_end_reason\": true,\n \"default_inter_digit_ms\": 1000,\n \"inter_digit_ms\": 1000,\n \"default_duration_ms\": 1020,\n \"default_volume\": 50,\n \"ivr_detection\": true,\n \"allowed_digits\": \"<string>\",\n \"max_sequence_length\": 64,\n \"sip_trunk_id\": \"<string>\",\n \"sip_trunk_address\": \"<string>\",\n \"sip_headers\": {},\n \"hold_audio_url\": \"<string>\",\n \"hold_audio_loop\": true,\n \"transfer_briefing_prompt\": \"<string>\",\n \"transfer_briefing_voice_id\": \"<string>\",\n \"transfer_announcement_prompt\": \"<string>\",\n \"transfer_announcement\": \"<string>\",\n \"transfer_timeout_s\": 150,\n \"transfer_max_attempts\": 5,\n \"fallback_target_name\": \"<string>\",\n \"take_message_on_failure\": true,\n \"target_directory\": [\n \"<string>\"\n ],\n \"target_number\": \"<string>\",\n \"targets\": [\n {}\n ],\n \"play_dialtone\": true,\n \"cold_transfer_announcement_prompt\": \"<string>\",\n \"specialists\": [\n {}\n ],\n \"prefer_warm\": true,\n \"handoff_announcement_prompt\": \"<string>\",\n \"preserve_chat_ctx\": true,\n \"chat_ctx_token_cap\": 32128,\n \"service_account_email\": \"<string>\",\n \"oauth_refresh_token_ref\": \"<string>\",\n \"default_spreadsheet_id\": \"<string>\",\n \"allowed_spreadsheet_ids\": [\n \"<string>\"\n ],\n \"max_rows_per_read\": 5000,\n \"max_rows_per_write\": 2500,\n \"result_summarization\": true,\n \"spreadsheet_id\": \"<string>\",\n \"sheet_name\": \"<string>\",\n \"credentials_json\": {},\n \"column_mapping\": {},\n \"data_source_url\": \"<string>\",\n \"auth_secret_ref\": \"<string>\",\n \"query_template\": \"<string>\",\n \"allowed_filters\": [\n \"<string>\"\n ],\n \"default_limit\": 250,\n \"max_limit\": 500,\n \"pii_redaction\": true,\n \"cache_ttl_s\": 43200,\n \"top_k_default\": 10,\n \"similarity_threshold\": 0.5,\n \"knowledge_namespace\": \"<string>\",\n \"account_sid_ref\": \"<string>\",\n \"auth_token_ref\": \"<string>\",\n \"from_e164\": \"<string>\",\n \"default_from\": \"<string>\",\n \"allowed_destination_country_codes\": [\n \"<string>\"\n ],\n \"allow_send_to_caller_only\": true,\n \"max_message_length\": 1000,\n \"template_id\": \"<string>\",\n \"template\": \"<string>\",\n \"daily_quota_per_number\": 500,\n \"require_explicit_consent\": true,\n \"url\": \"<string>\",\n \"url_allowlist\": [\n \"<string>\"\n ],\n \"allowed_methods\": [\n \"<string>\"\n ],\n \"default_headers\": {},\n \"method\": \"<string>\",\n \"headers\": {},\n \"auth\": {\n \"type\": \"none\",\n \"token\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"api_key_header\": \"X-API-Key\",\n \"api_key_value\": \"<string>\"\n },\n \"signing_secret_ref\": \"<string>\",\n \"timeout_s\": 60,\n \"timeout_seconds\": 60,\n \"max_retries\": 5,\n \"max_body_bytes\": 5000064,\n \"redact_response_pii\": true,\n \"body_template\": \"<string>\",\n \"retry_policy\": {},\n \"simulate_latency_ms\": 15000,\n \"simulate_error_rate\": 0.5,\n \"expected_inputs\": {},\n \"canned_response\": \"<string>\",\n \"response_template\": \"<string>\",\n \"latency_ms\": 15000,\n \"handler_ref\": \"<string>\",\n \"raw_schema\": {},\n \"parameters_schema\": {},\n \"execution_endpoint\": \"<string>\",\n \"python_code\": \"<string>\",\n \"rpc_method\": \"<string>\",\n \"mcp_url\": \"<string>\",\n \"mcp_allowlist\": [\n \"<string>\"\n ],\n \"bearer_token\": \"<string>\",\n \"extra_headers\": {},\n \"is_end_call\": true,\n \"is_transfer\": true,\n \"webhook_url\": \"<string>\",\n \"auth_config\": {}\n },\n \"tool_type\": \"function\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/agents/{agent_id}/tools")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tool_key\": \"<string>\",\n \"instance_name\": \"<string>\",\n \"display_name\": \"<string>\",\n \"enabled\": true,\n \"config\": {\n \"description\": \"<string>\",\n \"disallow_interruptions\": true,\n \"requires_caller_consent\": true,\n \"cost_unit\": \"<string>\",\n \"goodbye_instructions\": \"<string>\",\n \"goodbye_max_duration_ms\": 10250,\n \"delete_room\": true,\n \"wait_for_playout\": true,\n \"record_end_reason\": true,\n \"default_inter_digit_ms\": 1000,\n \"inter_digit_ms\": 1000,\n \"default_duration_ms\": 1020,\n \"default_volume\": 50,\n \"ivr_detection\": true,\n \"allowed_digits\": \"<string>\",\n \"max_sequence_length\": 64,\n \"sip_trunk_id\": \"<string>\",\n \"sip_trunk_address\": \"<string>\",\n \"sip_headers\": {},\n \"hold_audio_url\": \"<string>\",\n \"hold_audio_loop\": true,\n \"transfer_briefing_prompt\": \"<string>\",\n \"transfer_briefing_voice_id\": \"<string>\",\n \"transfer_announcement_prompt\": \"<string>\",\n \"transfer_announcement\": \"<string>\",\n \"transfer_timeout_s\": 150,\n \"transfer_max_attempts\": 5,\n \"fallback_target_name\": \"<string>\",\n \"take_message_on_failure\": true,\n \"target_directory\": [\n \"<string>\"\n ],\n \"target_number\": \"<string>\",\n \"targets\": [\n {}\n ],\n \"play_dialtone\": true,\n \"cold_transfer_announcement_prompt\": \"<string>\",\n \"specialists\": [\n {}\n ],\n \"prefer_warm\": true,\n \"handoff_announcement_prompt\": \"<string>\",\n \"preserve_chat_ctx\": true,\n \"chat_ctx_token_cap\": 32128,\n \"service_account_email\": \"<string>\",\n \"oauth_refresh_token_ref\": \"<string>\",\n \"default_spreadsheet_id\": \"<string>\",\n \"allowed_spreadsheet_ids\": [\n \"<string>\"\n ],\n \"max_rows_per_read\": 5000,\n \"max_rows_per_write\": 2500,\n \"result_summarization\": true,\n \"spreadsheet_id\": \"<string>\",\n \"sheet_name\": \"<string>\",\n \"credentials_json\": {},\n \"column_mapping\": {},\n \"data_source_url\": \"<string>\",\n \"auth_secret_ref\": \"<string>\",\n \"query_template\": \"<string>\",\n \"allowed_filters\": [\n \"<string>\"\n ],\n \"default_limit\": 250,\n \"max_limit\": 500,\n \"pii_redaction\": true,\n \"cache_ttl_s\": 43200,\n \"top_k_default\": 10,\n \"similarity_threshold\": 0.5,\n \"knowledge_namespace\": \"<string>\",\n \"account_sid_ref\": \"<string>\",\n \"auth_token_ref\": \"<string>\",\n \"from_e164\": \"<string>\",\n \"default_from\": \"<string>\",\n \"allowed_destination_country_codes\": [\n \"<string>\"\n ],\n \"allow_send_to_caller_only\": true,\n \"max_message_length\": 1000,\n \"template_id\": \"<string>\",\n \"template\": \"<string>\",\n \"daily_quota_per_number\": 500,\n \"require_explicit_consent\": true,\n \"url\": \"<string>\",\n \"url_allowlist\": [\n \"<string>\"\n ],\n \"allowed_methods\": [\n \"<string>\"\n ],\n \"default_headers\": {},\n \"method\": \"<string>\",\n \"headers\": {},\n \"auth\": {\n \"type\": \"none\",\n \"token\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"api_key_header\": \"X-API-Key\",\n \"api_key_value\": \"<string>\"\n },\n \"signing_secret_ref\": \"<string>\",\n \"timeout_s\": 60,\n \"timeout_seconds\": 60,\n \"max_retries\": 5,\n \"max_body_bytes\": 5000064,\n \"redact_response_pii\": true,\n \"body_template\": \"<string>\",\n \"retry_policy\": {},\n \"simulate_latency_ms\": 15000,\n \"simulate_error_rate\": 0.5,\n \"expected_inputs\": {},\n \"canned_response\": \"<string>\",\n \"response_template\": \"<string>\",\n \"latency_ms\": 15000,\n \"handler_ref\": \"<string>\",\n \"raw_schema\": {},\n \"parameters_schema\": {},\n \"execution_endpoint\": \"<string>\",\n \"python_code\": \"<string>\",\n \"rpc_method\": \"<string>\",\n \"mcp_url\": \"<string>\",\n \"mcp_allowlist\": [\n \"<string>\"\n ],\n \"bearer_token\": \"<string>\",\n \"extra_headers\": {},\n \"is_end_call\": true,\n \"is_transfer\": true,\n \"webhook_url\": \"<string>\",\n \"auth_config\": {}\n },\n \"tool_type\": \"function\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agent_id": "<string>",
"tool_key": "<string>",
"instance_name": "<string>",
"display_name": "<string>",
"tool_type": "<string>",
"enabled": true,
"is_active": true,
"version": 123,
"config": {},
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"raw_schema": {},
"rpc_method": "<string>",
"parameters_schema": {},
"registry_info": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Schema for creating a new agent_tool instance.
The user is configuring a specific instance — a tool type (tool_key)
plus a meaningful instance_name plus per-instance config. A tool
cannot be added "raw" (just a type with no instance_name and no config)
— the controller enforces this:
- tool_key MUST exist in the registry (
tool_registrytable) - instance_name is REQUIRED (no silent default to tool_key)
- per-type required CFG fields are validated (e.g. http_webhook needs url_allowlist; send_text_tool needs provider+from_e164+secret refs)
Tool type identifier from the registry. Must match an entry from GET /agents/{agent_id}/tools/registry/available.
Stable identifier the LLM will use to call this tool. Must be meaningful (e.g. 'transfer_to_billing', 'end_call_polite'); the same tool_key can be instanced multiple times with different configs. Must be unique per agent. Pattern: ^[A-Za-z][A-Za-z0-9_-]{0,118}[A-Za-z0-9]?$
1 - 120Human-friendly UI label.
Aggregate config for a tool instance — full v2 Field Reference superset.
Frontend may submit any subset of these fields. Whatever is non-None is persisted into the agent_tool.config JSON blob. The runtime reads only the fields relevant to the resolved tool_type.
Section numbers below cite mr-assistant-tools-field-reference v2.
Show child attributes
Show child attributes
Response
Successful Response
Schema for tool response.
curl --request POST \
--url https://api.example.com/agents/{agent_id}/tools \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tool_key": "<string>",
"instance_name": "<string>",
"display_name": "<string>",
"enabled": true,
"config": {
"description": "<string>",
"disallow_interruptions": true,
"requires_caller_consent": true,
"cost_unit": "<string>",
"goodbye_instructions": "<string>",
"goodbye_max_duration_ms": 10250,
"delete_room": true,
"wait_for_playout": true,
"record_end_reason": true,
"default_inter_digit_ms": 1000,
"inter_digit_ms": 1000,
"default_duration_ms": 1020,
"default_volume": 50,
"ivr_detection": true,
"allowed_digits": "<string>",
"max_sequence_length": 64,
"sip_trunk_id": "<string>",
"sip_trunk_address": "<string>",
"sip_headers": {},
"hold_audio_url": "<string>",
"hold_audio_loop": true,
"transfer_briefing_prompt": "<string>",
"transfer_briefing_voice_id": "<string>",
"transfer_announcement_prompt": "<string>",
"transfer_announcement": "<string>",
"transfer_timeout_s": 150,
"transfer_max_attempts": 5,
"fallback_target_name": "<string>",
"take_message_on_failure": true,
"target_directory": [
"<string>"
],
"target_number": "<string>",
"targets": [
{}
],
"play_dialtone": true,
"cold_transfer_announcement_prompt": "<string>",
"specialists": [
{}
],
"prefer_warm": true,
"handoff_announcement_prompt": "<string>",
"preserve_chat_ctx": true,
"chat_ctx_token_cap": 32128,
"service_account_email": "<string>",
"oauth_refresh_token_ref": "<string>",
"default_spreadsheet_id": "<string>",
"allowed_spreadsheet_ids": [
"<string>"
],
"max_rows_per_read": 5000,
"max_rows_per_write": 2500,
"result_summarization": true,
"spreadsheet_id": "<string>",
"sheet_name": "<string>",
"credentials_json": {},
"column_mapping": {},
"data_source_url": "<string>",
"auth_secret_ref": "<string>",
"query_template": "<string>",
"allowed_filters": [
"<string>"
],
"default_limit": 250,
"max_limit": 500,
"pii_redaction": true,
"cache_ttl_s": 43200,
"top_k_default": 10,
"similarity_threshold": 0.5,
"knowledge_namespace": "<string>",
"account_sid_ref": "<string>",
"auth_token_ref": "<string>",
"from_e164": "<string>",
"default_from": "<string>",
"allowed_destination_country_codes": [
"<string>"
],
"allow_send_to_caller_only": true,
"max_message_length": 1000,
"template_id": "<string>",
"template": "<string>",
"daily_quota_per_number": 500,
"require_explicit_consent": true,
"url": "<string>",
"url_allowlist": [
"<string>"
],
"allowed_methods": [
"<string>"
],
"default_headers": {},
"method": "<string>",
"headers": {},
"auth": {
"type": "none",
"token": "<string>",
"username": "<string>",
"password": "<string>",
"api_key_header": "X-API-Key",
"api_key_value": "<string>"
},
"signing_secret_ref": "<string>",
"timeout_s": 60,
"timeout_seconds": 60,
"max_retries": 5,
"max_body_bytes": 5000064,
"redact_response_pii": true,
"body_template": "<string>",
"retry_policy": {},
"simulate_latency_ms": 15000,
"simulate_error_rate": 0.5,
"expected_inputs": {},
"canned_response": "<string>",
"response_template": "<string>",
"latency_ms": 15000,
"handler_ref": "<string>",
"raw_schema": {},
"parameters_schema": {},
"execution_endpoint": "<string>",
"python_code": "<string>",
"rpc_method": "<string>",
"mcp_url": "<string>",
"mcp_allowlist": [
"<string>"
],
"bearer_token": "<string>",
"extra_headers": {},
"is_end_call": true,
"is_transfer": true,
"webhook_url": "<string>",
"auth_config": {}
},
"tool_type": "function",
"description": "<string>"
}
'import requests
url = "https://api.example.com/agents/{agent_id}/tools"
payload = {
"tool_key": "<string>",
"instance_name": "<string>",
"display_name": "<string>",
"enabled": True,
"config": {
"description": "<string>",
"disallow_interruptions": True,
"requires_caller_consent": True,
"cost_unit": "<string>",
"goodbye_instructions": "<string>",
"goodbye_max_duration_ms": 10250,
"delete_room": True,
"wait_for_playout": True,
"record_end_reason": True,
"default_inter_digit_ms": 1000,
"inter_digit_ms": 1000,
"default_duration_ms": 1020,
"default_volume": 50,
"ivr_detection": True,
"allowed_digits": "<string>",
"max_sequence_length": 64,
"sip_trunk_id": "<string>",
"sip_trunk_address": "<string>",
"sip_headers": {},
"hold_audio_url": "<string>",
"hold_audio_loop": True,
"transfer_briefing_prompt": "<string>",
"transfer_briefing_voice_id": "<string>",
"transfer_announcement_prompt": "<string>",
"transfer_announcement": "<string>",
"transfer_timeout_s": 150,
"transfer_max_attempts": 5,
"fallback_target_name": "<string>",
"take_message_on_failure": True,
"target_directory": ["<string>"],
"target_number": "<string>",
"targets": [{}],
"play_dialtone": True,
"cold_transfer_announcement_prompt": "<string>",
"specialists": [{}],
"prefer_warm": True,
"handoff_announcement_prompt": "<string>",
"preserve_chat_ctx": True,
"chat_ctx_token_cap": 32128,
"service_account_email": "<string>",
"oauth_refresh_token_ref": "<string>",
"default_spreadsheet_id": "<string>",
"allowed_spreadsheet_ids": ["<string>"],
"max_rows_per_read": 5000,
"max_rows_per_write": 2500,
"result_summarization": True,
"spreadsheet_id": "<string>",
"sheet_name": "<string>",
"credentials_json": {},
"column_mapping": {},
"data_source_url": "<string>",
"auth_secret_ref": "<string>",
"query_template": "<string>",
"allowed_filters": ["<string>"],
"default_limit": 250,
"max_limit": 500,
"pii_redaction": True,
"cache_ttl_s": 43200,
"top_k_default": 10,
"similarity_threshold": 0.5,
"knowledge_namespace": "<string>",
"account_sid_ref": "<string>",
"auth_token_ref": "<string>",
"from_e164": "<string>",
"default_from": "<string>",
"allowed_destination_country_codes": ["<string>"],
"allow_send_to_caller_only": True,
"max_message_length": 1000,
"template_id": "<string>",
"template": "<string>",
"daily_quota_per_number": 500,
"require_explicit_consent": True,
"url": "<string>",
"url_allowlist": ["<string>"],
"allowed_methods": ["<string>"],
"default_headers": {},
"method": "<string>",
"headers": {},
"auth": {
"type": "none",
"token": "<string>",
"username": "<string>",
"password": "<string>",
"api_key_header": "X-API-Key",
"api_key_value": "<string>"
},
"signing_secret_ref": "<string>",
"timeout_s": 60,
"timeout_seconds": 60,
"max_retries": 5,
"max_body_bytes": 5000064,
"redact_response_pii": True,
"body_template": "<string>",
"retry_policy": {},
"simulate_latency_ms": 15000,
"simulate_error_rate": 0.5,
"expected_inputs": {},
"canned_response": "<string>",
"response_template": "<string>",
"latency_ms": 15000,
"handler_ref": "<string>",
"raw_schema": {},
"parameters_schema": {},
"execution_endpoint": "<string>",
"python_code": "<string>",
"rpc_method": "<string>",
"mcp_url": "<string>",
"mcp_allowlist": ["<string>"],
"bearer_token": "<string>",
"extra_headers": {},
"is_end_call": True,
"is_transfer": True,
"webhook_url": "<string>",
"auth_config": {}
},
"tool_type": "function",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tool_key: '<string>',
instance_name: '<string>',
display_name: '<string>',
enabled: true,
config: {
description: '<string>',
disallow_interruptions: true,
requires_caller_consent: true,
cost_unit: '<string>',
goodbye_instructions: '<string>',
goodbye_max_duration_ms: 10250,
delete_room: true,
wait_for_playout: true,
record_end_reason: true,
default_inter_digit_ms: 1000,
inter_digit_ms: 1000,
default_duration_ms: 1020,
default_volume: 50,
ivr_detection: true,
allowed_digits: '<string>',
max_sequence_length: 64,
sip_trunk_id: '<string>',
sip_trunk_address: '<string>',
sip_headers: {},
hold_audio_url: '<string>',
hold_audio_loop: true,
transfer_briefing_prompt: '<string>',
transfer_briefing_voice_id: '<string>',
transfer_announcement_prompt: '<string>',
transfer_announcement: '<string>',
transfer_timeout_s: 150,
transfer_max_attempts: 5,
fallback_target_name: '<string>',
take_message_on_failure: true,
target_directory: ['<string>'],
target_number: '<string>',
targets: [{}],
play_dialtone: true,
cold_transfer_announcement_prompt: '<string>',
specialists: [{}],
prefer_warm: true,
handoff_announcement_prompt: '<string>',
preserve_chat_ctx: true,
chat_ctx_token_cap: 32128,
service_account_email: '<string>',
oauth_refresh_token_ref: '<string>',
default_spreadsheet_id: '<string>',
allowed_spreadsheet_ids: ['<string>'],
max_rows_per_read: 5000,
max_rows_per_write: 2500,
result_summarization: true,
spreadsheet_id: '<string>',
sheet_name: '<string>',
credentials_json: {},
column_mapping: {},
data_source_url: '<string>',
auth_secret_ref: '<string>',
query_template: '<string>',
allowed_filters: ['<string>'],
default_limit: 250,
max_limit: 500,
pii_redaction: true,
cache_ttl_s: 43200,
top_k_default: 10,
similarity_threshold: 0.5,
knowledge_namespace: '<string>',
account_sid_ref: '<string>',
auth_token_ref: '<string>',
from_e164: '<string>',
default_from: '<string>',
allowed_destination_country_codes: ['<string>'],
allow_send_to_caller_only: true,
max_message_length: 1000,
template_id: '<string>',
template: '<string>',
daily_quota_per_number: 500,
require_explicit_consent: true,
url: '<string>',
url_allowlist: ['<string>'],
allowed_methods: ['<string>'],
default_headers: {},
method: '<string>',
headers: {},
auth: {
type: 'none',
token: '<string>',
username: '<string>',
password: '<string>',
api_key_header: 'X-API-Key',
api_key_value: '<string>'
},
signing_secret_ref: '<string>',
timeout_s: 60,
timeout_seconds: 60,
max_retries: 5,
max_body_bytes: 5000064,
redact_response_pii: true,
body_template: '<string>',
retry_policy: {},
simulate_latency_ms: 15000,
simulate_error_rate: 0.5,
expected_inputs: {},
canned_response: '<string>',
response_template: '<string>',
latency_ms: 15000,
handler_ref: '<string>',
raw_schema: {},
parameters_schema: {},
execution_endpoint: '<string>',
python_code: '<string>',
rpc_method: '<string>',
mcp_url: '<string>',
mcp_allowlist: ['<string>'],
bearer_token: '<string>',
extra_headers: {},
is_end_call: true,
is_transfer: true,
webhook_url: '<string>',
auth_config: {}
},
tool_type: 'function',
description: '<string>'
})
};
fetch('https://api.example.com/agents/{agent_id}/tools', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/agents/{agent_id}/tools",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tool_key' => '<string>',
'instance_name' => '<string>',
'display_name' => '<string>',
'enabled' => true,
'config' => [
'description' => '<string>',
'disallow_interruptions' => true,
'requires_caller_consent' => true,
'cost_unit' => '<string>',
'goodbye_instructions' => '<string>',
'goodbye_max_duration_ms' => 10250,
'delete_room' => true,
'wait_for_playout' => true,
'record_end_reason' => true,
'default_inter_digit_ms' => 1000,
'inter_digit_ms' => 1000,
'default_duration_ms' => 1020,
'default_volume' => 50,
'ivr_detection' => true,
'allowed_digits' => '<string>',
'max_sequence_length' => 64,
'sip_trunk_id' => '<string>',
'sip_trunk_address' => '<string>',
'sip_headers' => [
],
'hold_audio_url' => '<string>',
'hold_audio_loop' => true,
'transfer_briefing_prompt' => '<string>',
'transfer_briefing_voice_id' => '<string>',
'transfer_announcement_prompt' => '<string>',
'transfer_announcement' => '<string>',
'transfer_timeout_s' => 150,
'transfer_max_attempts' => 5,
'fallback_target_name' => '<string>',
'take_message_on_failure' => true,
'target_directory' => [
'<string>'
],
'target_number' => '<string>',
'targets' => [
[
]
],
'play_dialtone' => true,
'cold_transfer_announcement_prompt' => '<string>',
'specialists' => [
[
]
],
'prefer_warm' => true,
'handoff_announcement_prompt' => '<string>',
'preserve_chat_ctx' => true,
'chat_ctx_token_cap' => 32128,
'service_account_email' => '<string>',
'oauth_refresh_token_ref' => '<string>',
'default_spreadsheet_id' => '<string>',
'allowed_spreadsheet_ids' => [
'<string>'
],
'max_rows_per_read' => 5000,
'max_rows_per_write' => 2500,
'result_summarization' => true,
'spreadsheet_id' => '<string>',
'sheet_name' => '<string>',
'credentials_json' => [
],
'column_mapping' => [
],
'data_source_url' => '<string>',
'auth_secret_ref' => '<string>',
'query_template' => '<string>',
'allowed_filters' => [
'<string>'
],
'default_limit' => 250,
'max_limit' => 500,
'pii_redaction' => true,
'cache_ttl_s' => 43200,
'top_k_default' => 10,
'similarity_threshold' => 0.5,
'knowledge_namespace' => '<string>',
'account_sid_ref' => '<string>',
'auth_token_ref' => '<string>',
'from_e164' => '<string>',
'default_from' => '<string>',
'allowed_destination_country_codes' => [
'<string>'
],
'allow_send_to_caller_only' => true,
'max_message_length' => 1000,
'template_id' => '<string>',
'template' => '<string>',
'daily_quota_per_number' => 500,
'require_explicit_consent' => true,
'url' => '<string>',
'url_allowlist' => [
'<string>'
],
'allowed_methods' => [
'<string>'
],
'default_headers' => [
],
'method' => '<string>',
'headers' => [
],
'auth' => [
'type' => 'none',
'token' => '<string>',
'username' => '<string>',
'password' => '<string>',
'api_key_header' => 'X-API-Key',
'api_key_value' => '<string>'
],
'signing_secret_ref' => '<string>',
'timeout_s' => 60,
'timeout_seconds' => 60,
'max_retries' => 5,
'max_body_bytes' => 5000064,
'redact_response_pii' => true,
'body_template' => '<string>',
'retry_policy' => [
],
'simulate_latency_ms' => 15000,
'simulate_error_rate' => 0.5,
'expected_inputs' => [
],
'canned_response' => '<string>',
'response_template' => '<string>',
'latency_ms' => 15000,
'handler_ref' => '<string>',
'raw_schema' => [
],
'parameters_schema' => [
],
'execution_endpoint' => '<string>',
'python_code' => '<string>',
'rpc_method' => '<string>',
'mcp_url' => '<string>',
'mcp_allowlist' => [
'<string>'
],
'bearer_token' => '<string>',
'extra_headers' => [
],
'is_end_call' => true,
'is_transfer' => true,
'webhook_url' => '<string>',
'auth_config' => [
]
],
'tool_type' => 'function',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/agents/{agent_id}/tools"
payload := strings.NewReader("{\n \"tool_key\": \"<string>\",\n \"instance_name\": \"<string>\",\n \"display_name\": \"<string>\",\n \"enabled\": true,\n \"config\": {\n \"description\": \"<string>\",\n \"disallow_interruptions\": true,\n \"requires_caller_consent\": true,\n \"cost_unit\": \"<string>\",\n \"goodbye_instructions\": \"<string>\",\n \"goodbye_max_duration_ms\": 10250,\n \"delete_room\": true,\n \"wait_for_playout\": true,\n \"record_end_reason\": true,\n \"default_inter_digit_ms\": 1000,\n \"inter_digit_ms\": 1000,\n \"default_duration_ms\": 1020,\n \"default_volume\": 50,\n \"ivr_detection\": true,\n \"allowed_digits\": \"<string>\",\n \"max_sequence_length\": 64,\n \"sip_trunk_id\": \"<string>\",\n \"sip_trunk_address\": \"<string>\",\n \"sip_headers\": {},\n \"hold_audio_url\": \"<string>\",\n \"hold_audio_loop\": true,\n \"transfer_briefing_prompt\": \"<string>\",\n \"transfer_briefing_voice_id\": \"<string>\",\n \"transfer_announcement_prompt\": \"<string>\",\n \"transfer_announcement\": \"<string>\",\n \"transfer_timeout_s\": 150,\n \"transfer_max_attempts\": 5,\n \"fallback_target_name\": \"<string>\",\n \"take_message_on_failure\": true,\n \"target_directory\": [\n \"<string>\"\n ],\n \"target_number\": \"<string>\",\n \"targets\": [\n {}\n ],\n \"play_dialtone\": true,\n \"cold_transfer_announcement_prompt\": \"<string>\",\n \"specialists\": [\n {}\n ],\n \"prefer_warm\": true,\n \"handoff_announcement_prompt\": \"<string>\",\n \"preserve_chat_ctx\": true,\n \"chat_ctx_token_cap\": 32128,\n \"service_account_email\": \"<string>\",\n \"oauth_refresh_token_ref\": \"<string>\",\n \"default_spreadsheet_id\": \"<string>\",\n \"allowed_spreadsheet_ids\": [\n \"<string>\"\n ],\n \"max_rows_per_read\": 5000,\n \"max_rows_per_write\": 2500,\n \"result_summarization\": true,\n \"spreadsheet_id\": \"<string>\",\n \"sheet_name\": \"<string>\",\n \"credentials_json\": {},\n \"column_mapping\": {},\n \"data_source_url\": \"<string>\",\n \"auth_secret_ref\": \"<string>\",\n \"query_template\": \"<string>\",\n \"allowed_filters\": [\n \"<string>\"\n ],\n \"default_limit\": 250,\n \"max_limit\": 500,\n \"pii_redaction\": true,\n \"cache_ttl_s\": 43200,\n \"top_k_default\": 10,\n \"similarity_threshold\": 0.5,\n \"knowledge_namespace\": \"<string>\",\n \"account_sid_ref\": \"<string>\",\n \"auth_token_ref\": \"<string>\",\n \"from_e164\": \"<string>\",\n \"default_from\": \"<string>\",\n \"allowed_destination_country_codes\": [\n \"<string>\"\n ],\n \"allow_send_to_caller_only\": true,\n \"max_message_length\": 1000,\n \"template_id\": \"<string>\",\n \"template\": \"<string>\",\n \"daily_quota_per_number\": 500,\n \"require_explicit_consent\": true,\n \"url\": \"<string>\",\n \"url_allowlist\": [\n \"<string>\"\n ],\n \"allowed_methods\": [\n \"<string>\"\n ],\n \"default_headers\": {},\n \"method\": \"<string>\",\n \"headers\": {},\n \"auth\": {\n \"type\": \"none\",\n \"token\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"api_key_header\": \"X-API-Key\",\n \"api_key_value\": \"<string>\"\n },\n \"signing_secret_ref\": \"<string>\",\n \"timeout_s\": 60,\n \"timeout_seconds\": 60,\n \"max_retries\": 5,\n \"max_body_bytes\": 5000064,\n \"redact_response_pii\": true,\n \"body_template\": \"<string>\",\n \"retry_policy\": {},\n \"simulate_latency_ms\": 15000,\n \"simulate_error_rate\": 0.5,\n \"expected_inputs\": {},\n \"canned_response\": \"<string>\",\n \"response_template\": \"<string>\",\n \"latency_ms\": 15000,\n \"handler_ref\": \"<string>\",\n \"raw_schema\": {},\n \"parameters_schema\": {},\n \"execution_endpoint\": \"<string>\",\n \"python_code\": \"<string>\",\n \"rpc_method\": \"<string>\",\n \"mcp_url\": \"<string>\",\n \"mcp_allowlist\": [\n \"<string>\"\n ],\n \"bearer_token\": \"<string>\",\n \"extra_headers\": {},\n \"is_end_call\": true,\n \"is_transfer\": true,\n \"webhook_url\": \"<string>\",\n \"auth_config\": {}\n },\n \"tool_type\": \"function\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/agents/{agent_id}/tools")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tool_key\": \"<string>\",\n \"instance_name\": \"<string>\",\n \"display_name\": \"<string>\",\n \"enabled\": true,\n \"config\": {\n \"description\": \"<string>\",\n \"disallow_interruptions\": true,\n \"requires_caller_consent\": true,\n \"cost_unit\": \"<string>\",\n \"goodbye_instructions\": \"<string>\",\n \"goodbye_max_duration_ms\": 10250,\n \"delete_room\": true,\n \"wait_for_playout\": true,\n \"record_end_reason\": true,\n \"default_inter_digit_ms\": 1000,\n \"inter_digit_ms\": 1000,\n \"default_duration_ms\": 1020,\n \"default_volume\": 50,\n \"ivr_detection\": true,\n \"allowed_digits\": \"<string>\",\n \"max_sequence_length\": 64,\n \"sip_trunk_id\": \"<string>\",\n \"sip_trunk_address\": \"<string>\",\n \"sip_headers\": {},\n \"hold_audio_url\": \"<string>\",\n \"hold_audio_loop\": true,\n \"transfer_briefing_prompt\": \"<string>\",\n \"transfer_briefing_voice_id\": \"<string>\",\n \"transfer_announcement_prompt\": \"<string>\",\n \"transfer_announcement\": \"<string>\",\n \"transfer_timeout_s\": 150,\n \"transfer_max_attempts\": 5,\n \"fallback_target_name\": \"<string>\",\n \"take_message_on_failure\": true,\n \"target_directory\": [\n \"<string>\"\n ],\n \"target_number\": \"<string>\",\n \"targets\": [\n {}\n ],\n \"play_dialtone\": true,\n \"cold_transfer_announcement_prompt\": \"<string>\",\n \"specialists\": [\n {}\n ],\n \"prefer_warm\": true,\n \"handoff_announcement_prompt\": \"<string>\",\n \"preserve_chat_ctx\": true,\n \"chat_ctx_token_cap\": 32128,\n \"service_account_email\": \"<string>\",\n \"oauth_refresh_token_ref\": \"<string>\",\n \"default_spreadsheet_id\": \"<string>\",\n \"allowed_spreadsheet_ids\": [\n \"<string>\"\n ],\n \"max_rows_per_read\": 5000,\n \"max_rows_per_write\": 2500,\n \"result_summarization\": true,\n \"spreadsheet_id\": \"<string>\",\n \"sheet_name\": \"<string>\",\n \"credentials_json\": {},\n \"column_mapping\": {},\n \"data_source_url\": \"<string>\",\n \"auth_secret_ref\": \"<string>\",\n \"query_template\": \"<string>\",\n \"allowed_filters\": [\n \"<string>\"\n ],\n \"default_limit\": 250,\n \"max_limit\": 500,\n \"pii_redaction\": true,\n \"cache_ttl_s\": 43200,\n \"top_k_default\": 10,\n \"similarity_threshold\": 0.5,\n \"knowledge_namespace\": \"<string>\",\n \"account_sid_ref\": \"<string>\",\n \"auth_token_ref\": \"<string>\",\n \"from_e164\": \"<string>\",\n \"default_from\": \"<string>\",\n \"allowed_destination_country_codes\": [\n \"<string>\"\n ],\n \"allow_send_to_caller_only\": true,\n \"max_message_length\": 1000,\n \"template_id\": \"<string>\",\n \"template\": \"<string>\",\n \"daily_quota_per_number\": 500,\n \"require_explicit_consent\": true,\n \"url\": \"<string>\",\n \"url_allowlist\": [\n \"<string>\"\n ],\n \"allowed_methods\": [\n \"<string>\"\n ],\n \"default_headers\": {},\n \"method\": \"<string>\",\n \"headers\": {},\n \"auth\": {\n \"type\": \"none\",\n \"token\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"api_key_header\": \"X-API-Key\",\n \"api_key_value\": \"<string>\"\n },\n \"signing_secret_ref\": \"<string>\",\n \"timeout_s\": 60,\n \"timeout_seconds\": 60,\n \"max_retries\": 5,\n \"max_body_bytes\": 5000064,\n \"redact_response_pii\": true,\n \"body_template\": \"<string>\",\n \"retry_policy\": {},\n \"simulate_latency_ms\": 15000,\n \"simulate_error_rate\": 0.5,\n \"expected_inputs\": {},\n \"canned_response\": \"<string>\",\n \"response_template\": \"<string>\",\n \"latency_ms\": 15000,\n \"handler_ref\": \"<string>\",\n \"raw_schema\": {},\n \"parameters_schema\": {},\n \"execution_endpoint\": \"<string>\",\n \"python_code\": \"<string>\",\n \"rpc_method\": \"<string>\",\n \"mcp_url\": \"<string>\",\n \"mcp_allowlist\": [\n \"<string>\"\n ],\n \"bearer_token\": \"<string>\",\n \"extra_headers\": {},\n \"is_end_call\": true,\n \"is_transfer\": true,\n \"webhook_url\": \"<string>\",\n \"auth_config\": {}\n },\n \"tool_type\": \"function\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/agents/{agent_id}/tools")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tool_key\": \"<string>\",\n \"instance_name\": \"<string>\",\n \"display_name\": \"<string>\",\n \"enabled\": true,\n \"config\": {\n \"description\": \"<string>\",\n \"disallow_interruptions\": true,\n \"requires_caller_consent\": true,\n \"cost_unit\": \"<string>\",\n \"goodbye_instructions\": \"<string>\",\n \"goodbye_max_duration_ms\": 10250,\n \"delete_room\": true,\n \"wait_for_playout\": true,\n \"record_end_reason\": true,\n \"default_inter_digit_ms\": 1000,\n \"inter_digit_ms\": 1000,\n \"default_duration_ms\": 1020,\n \"default_volume\": 50,\n \"ivr_detection\": true,\n \"allowed_digits\": \"<string>\",\n \"max_sequence_length\": 64,\n \"sip_trunk_id\": \"<string>\",\n \"sip_trunk_address\": \"<string>\",\n \"sip_headers\": {},\n \"hold_audio_url\": \"<string>\",\n \"hold_audio_loop\": true,\n \"transfer_briefing_prompt\": \"<string>\",\n \"transfer_briefing_voice_id\": \"<string>\",\n \"transfer_announcement_prompt\": \"<string>\",\n \"transfer_announcement\": \"<string>\",\n \"transfer_timeout_s\": 150,\n \"transfer_max_attempts\": 5,\n \"fallback_target_name\": \"<string>\",\n \"take_message_on_failure\": true,\n \"target_directory\": [\n \"<string>\"\n ],\n \"target_number\": \"<string>\",\n \"targets\": [\n {}\n ],\n \"play_dialtone\": true,\n \"cold_transfer_announcement_prompt\": \"<string>\",\n \"specialists\": [\n {}\n ],\n \"prefer_warm\": true,\n \"handoff_announcement_prompt\": \"<string>\",\n \"preserve_chat_ctx\": true,\n \"chat_ctx_token_cap\": 32128,\n \"service_account_email\": \"<string>\",\n \"oauth_refresh_token_ref\": \"<string>\",\n \"default_spreadsheet_id\": \"<string>\",\n \"allowed_spreadsheet_ids\": [\n \"<string>\"\n ],\n \"max_rows_per_read\": 5000,\n \"max_rows_per_write\": 2500,\n \"result_summarization\": true,\n \"spreadsheet_id\": \"<string>\",\n \"sheet_name\": \"<string>\",\n \"credentials_json\": {},\n \"column_mapping\": {},\n \"data_source_url\": \"<string>\",\n \"auth_secret_ref\": \"<string>\",\n \"query_template\": \"<string>\",\n \"allowed_filters\": [\n \"<string>\"\n ],\n \"default_limit\": 250,\n \"max_limit\": 500,\n \"pii_redaction\": true,\n \"cache_ttl_s\": 43200,\n \"top_k_default\": 10,\n \"similarity_threshold\": 0.5,\n \"knowledge_namespace\": \"<string>\",\n \"account_sid_ref\": \"<string>\",\n \"auth_token_ref\": \"<string>\",\n \"from_e164\": \"<string>\",\n \"default_from\": \"<string>\",\n \"allowed_destination_country_codes\": [\n \"<string>\"\n ],\n \"allow_send_to_caller_only\": true,\n \"max_message_length\": 1000,\n \"template_id\": \"<string>\",\n \"template\": \"<string>\",\n \"daily_quota_per_number\": 500,\n \"require_explicit_consent\": true,\n \"url\": \"<string>\",\n \"url_allowlist\": [\n \"<string>\"\n ],\n \"allowed_methods\": [\n \"<string>\"\n ],\n \"default_headers\": {},\n \"method\": \"<string>\",\n \"headers\": {},\n \"auth\": {\n \"type\": \"none\",\n \"token\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"api_key_header\": \"X-API-Key\",\n \"api_key_value\": \"<string>\"\n },\n \"signing_secret_ref\": \"<string>\",\n \"timeout_s\": 60,\n \"timeout_seconds\": 60,\n \"max_retries\": 5,\n \"max_body_bytes\": 5000064,\n \"redact_response_pii\": true,\n \"body_template\": \"<string>\",\n \"retry_policy\": {},\n \"simulate_latency_ms\": 15000,\n \"simulate_error_rate\": 0.5,\n \"expected_inputs\": {},\n \"canned_response\": \"<string>\",\n \"response_template\": \"<string>\",\n \"latency_ms\": 15000,\n \"handler_ref\": \"<string>\",\n \"raw_schema\": {},\n \"parameters_schema\": {},\n \"execution_endpoint\": \"<string>\",\n \"python_code\": \"<string>\",\n \"rpc_method\": \"<string>\",\n \"mcp_url\": \"<string>\",\n \"mcp_allowlist\": [\n \"<string>\"\n ],\n \"bearer_token\": \"<string>\",\n \"extra_headers\": {},\n \"is_end_call\": true,\n \"is_transfer\": true,\n \"webhook_url\": \"<string>\",\n \"auth_config\": {}\n },\n \"tool_type\": \"function\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agent_id": "<string>",
"tool_key": "<string>",
"instance_name": "<string>",
"display_name": "<string>",
"tool_type": "<string>",
"enabled": true,
"is_active": true,
"version": 123,
"config": {},
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"raw_schema": {},
"rpc_method": "<string>",
"parameters_schema": {},
"registry_info": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}