or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

audio

audio-processing.mdrealtime-transcription.mdspeech-to-speech.mdspeech-to-text.mdtext-to-speech.md
index.md
tile.json

tools.mddocs/conversational/

Custom Tools

Create and manage custom tools for agents to call external APIs and services.

Quick Reference

import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";

const client = new ElevenLabsClient({ apiKey: "your-api-key" });
// Access this API via: client.conversationalAi.tools

Tool Management

/**
 * Create a custom tool
 */
client.conversationalAi.tools.create(
  request: CreateToolRequest,
  requestOptions?: RequestOptions
): HttpResponsePromise<CreateToolResponseModel>;

/**
 * List tools
 */
client.conversationalAi.tools.list(
  requestOptions?: RequestOptions
): HttpResponsePromise<GetToolsResponseModel>;

/**
 * Get tool details
 */
client.conversationalAi.tools.get(
  tool_id: string,
  requestOptions?: RequestOptions
): HttpResponsePromise<ToolResponseModel>;

/**
 * Update tool
 */
client.conversationalAi.tools.update(
  tool_id: string,
  request: UpdateToolRequest,
  requestOptions?: RequestOptions
): HttpResponsePromise<void>;

/**
 * Delete tool
 */
client.conversationalAi.tools.delete(
  tool_id: string,
  requestOptions?: RequestOptions
): HttpResponsePromise<void>;

/**
 * Get list of agents that depend on this tool
 * @param tool_id - ID of the requested tool
 * @param request - Pagination parameters
 * @param requestOptions - Optional request configuration
 * @returns Paginated list of agents using this tool
 * @throws UnprocessableEntityError if request fails
 */
client.conversationalAi.tools.getDependentAgents(
  tool_id: string,
  request?: ToolsGetDependentAgentsRequest,
  requestOptions?: RequestOptions
): HttpResponsePromise<GetToolDependentAgentsResponseModel>;

interface ToolsGetDependentAgentsRequest {
  /** Pagination cursor */
  cursor?: string;
  /** Page size */
  pageSize?: number;
}

interface GetToolDependentAgentsResponseModel {
  /** List of agents using this tool */
  agents: Array<{
    agent_id: string;
    agent_name: string;
  }>;
  /** Next page cursor */
  next_cursor?: string;
}

Usage Example

Create Custom Tool

import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";

const client = new ElevenLabsClient({ apiKey: "your-api-key" });

// Create a tool for checking order status
const tool = await client.conversationalAi.tools.create({
  name: "check_order_status",
  description: "Check the status of a customer order",
  parameters: {
    type: "object",
    properties: {
      order_id: {
        type: "string",
        description: "The order ID to check",
      },
    },
    required: ["order_id"],
  },
  webhook_url: "https://api.example.com/orders/status",
});