Skip to main content
LLM tool calling lets the PAL trigger functions based on what the user says during a conversation. Tools are reusable objects: create them once, and attach them to any number of PALs. They dispatch via the channel you pick on the delivery field - see Tool Delivery and Tool Authentication.
This page documents the tools registry (/v2/tools). If your PAL still defines tools inline under layers.llm.tools, see Legacy inline tool calling.

Tool Object

Top-Level Fields

parameters

Standard JSON Schema. Same shape as the OpenAI function.parameters object.

Examples

parameters

on_call reference

on_call controls what the PAL does while a tool is dispatched but has not yet returned. Defaults to generate_filler for llm tools; set it explicitly if you want a different behavior.

Examples

The LLM picks the filler line per-call (e.g. “Let me check that for you.”).

on_resolve reference

on_resolve controls what the PAL does with the tool’s result once it returns.
Seeing “Do not call this tool again” in the transcript? While Tavus waits for a tool result, the PAL may see a placeholder message with this text. It only means “don’t send the same request again while this call is still running.” The PAL can still use the tool later in the conversation.With add_to_context, the result arrives as a new message instead of replacing the placeholder, so you may see both in the transcript. This text can’t be changed with a setting. If your integration only needs the tool to perform an action and the PAL doesn’t need the result, consider fire_and_forget.

Examples

The LLM regenerates a contextual reply using the tool’s result. Most common choice.

Creating a Tool

Create tool
A successful create returns the full tool object including its tool_id:
Response
The tool_id (prefix t…) is how you reference the tool when attaching it to a PAL or updating / deleting it.

Attaching Tools to a PAL

A PAL only sees a tool if it is attached. Attach one or more tools in a single call:
Attach tools to PAL
List the tools currently attached to a PAL:
List PAL tools
Detach a single tool from a PAL:
Detach tool from PAL
Detaching removes the link between the PAL and the tool. The tool itself is untouched and still attached to any other PALs that use it.

End-to-End Example

  1. Create the tool at /v2/tools (see above). Save the returned tool_id.
  2. Attach it to a PAL at /v2/pals/{pal_id}/tools.
  3. Start a conversation with that PAL. The tool is now available to the face.
  4. Handle the tool call in your application:
  5. Return a result (only meaningful when on_resolve is not fire_and_forget):
    • App message delivery: send a conversation.tool_result event with the matching tool_call_id. See Tool Delivery.
    • API delivery: return a 2xx response with the result in the response body.

Errors

Replace <api-key> with your actual API key. You can generate one in the PAL Maker.