Flireo AI
WebsiteLinkedin
WebsiteLinkedin
  1. Api's
  • API Reference
    • Agents
      • List all agents
      • Create a new agent
      • Get an agent
      • Update an agent
      • Delete an agent
    • Tool Templates
      • List all tool templates
      • Create a new tool template
      • Get a tool template
      • Update a tool template
      • Delete a tool template
    • Numbers
      • List all phone numbers
      • Register a phone number
      • Get a phone number
      • Update a phone number
      • Delete a phone number
    • Calls
      • List calls
      • Get call by ID
      • Initiate outbound call
    • Call Control
      • Send control command to active call
    • Usage
      • Get usage logs
    • SIP Trunks
      • List SIP trunks
      • Create a SIP trunk
      • Get a SIP trunk
      • Delete a SIP trunk
    • Voices
      • List available voices
    • BYOK
      • Get BYOK configurations
      • Add BYOK configuration
      • Delete BYOK configuration
      • Get BYOK provider configurations
    • Domains
      • Get your domain
      • Add a domain
      • Delete your domain
      • List available Resend domains
      • Select and sync a Resend domain
      • Verify domain DNS records
      • Refresh domain status
    • Webhooks
      • Dynamic assistant configuration webhook
      • Tool/Function Call
      • Call Status Update
      • End of Call Report
    • Analysis Templates
      • List analysis templates
      • Create analysis template
      • Get analysis template
      • Update analysis template
      • Delete analysis template
    • Organization
      • Get organization information
    • Campaigns
      • List all campaigns
      • Create a campaign
      • Get a campaign
      • Update a campaign
      • Delete a campaign
      • List campaign leads
      • Add a lead
      • Remove a lead
  • Documentation
    • Get started
      • Quickstart
      • Introduction
      • Authentication
    • Core concepts
      • Agents
      • Phone numbers
      • Calls
      • Webhooks
    • Api's
      • Organization
      • Agents
      • Phone numbers
      • Sip trunks
      • Calls
      • Call control
      • Usage
      • Voices
      • BYOK
      • Domains
      • Analysis templates
      • Tool templates
    • Webhooks
      • Overview
      • Assistant request
      • Tool calls
      • Status update
      • End of call report
      • Security
    • Guides
      • BYOK Setup
      • Call analysis
      • Custom Tools
      • Call Transfers
      • xAI Realtime Integration
      • Analysis templates
      • Billing
      • Error codes
      • Rate limits
      • Sip Trunks
      • Tool templates
      • Troubleshooting
WebsiteLinkedin
WebsiteLinkedin
  1. Api's

Tool templates

Manage reusable tool templates that define functions, call transfers, and other capabilities for your AI agents.
Tool templates are saved as objects in agent configurations, not as references. This means agents continue working even if you delete a template.

Endpoints#

MethodEndpointDescription
GET/tool-templatesList all tool templates
POST/tool-templatesCreate a new tool template
GET/tool-templates/{id}Get a tool template
PATCH/tool-templates/{id}Update a tool template
DELETE/tool-templates/{id}Delete a tool template

List All Tool Templates#

Retrieve all tool templates in your organization.
GET /tool-templates

Request#

Response#

{
  "toolTemplates": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Customer Lookup",
      "description": "Look up customer information by phone number",
      "tool_type": "function",
      "tool_config": {
        "name": "lookup_customer",
        "description": "Retrieves customer details from CRM",
        "url": "https://api.example.com/customers",
        "parameters": {
          "type": "object",
          "properties": {
            "phone": {
              "type": "string",
              "description": "Customer phone number"
            }
          },
          "required": ["phone"]
        }
      },
      "created_at": "2025-12-29T10:00:00.000Z",
      "updated_at": "2025-12-29T10:00:00.000Z"
    }
  ]
}

Create a New Tool Template#

Create a new tool template. The name and tool_type fields are required.
POST /tool-templates

Request Body#

FieldTypeRequiredDescription
namestringYesDisplay name for the tool template
descriptionstringNoDescription of what this tool does
tool_typestringYesTool type: function, endCall, or transferCall
tool_configobjectYesConfiguration based on tool type (see below)

Tool Types#

Function Tool
End Call Tool
Transfer Call Tool
Custom functions that execute webhook calls when the AI decides to use them.
Example Request:
Function Tool Config Fields:
FieldTypeRequiredDescription
namestringYesFunction name in snake_case
descriptionstringYesDescription to help AI decide when to use this
urlstringNoWebhook URL (overrides agent's default)
parametersobjectYesJSON Schema defining function parameters
asyncbooleanNoFire-and-forget mode (default: false)
asyncResponsestringNoMessage AI says immediately in async mode

Response (201 Created)#

{
  "toolTemplate": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Customer Lookup",
    "description": "Look up customer information by phone number",
    "tool_type": "function",
    "tool_config": { ... },
    "created_at": "2025-12-29T10:00:00.000Z",
    "updated_at": "2025-12-29T10:00:00.000Z"
  }
}

Get a Tool Template#

Retrieve a specific tool template by ID.
GET /tool-templates/{id}

Parameters#

NameInTypeDescription
idpathUUIDTool template UUID

Request#

Response#

{
  "toolTemplate": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Customer Lookup",
    ...
  }
}

Update a Tool Template#

Update an existing tool template. Only provided fields will be updated.
PATCH /tool-templates/{id}

Parameters#

NameInTypeDescription
idpathUUIDTool template UUID

Request Body#

All fields are optional. Only include fields you want to update.

Example Request#

Response#

{
  "toolTemplate": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "description": "Updated description for customer lookup",
    ...
  }
}

Delete a Tool Template#

Delete a tool template.
DELETE /tool-templates/{id}
Deleting a template does not affect agents that are using it. The tool configuration is stored as an object in the agent, not as a reference.

Parameters#

NameInTypeDescription
idpathUUIDTool template UUID

Request#

Response#

{
  "success": true
}

Using Tools with Agents#

Tool templates define reusable tool configurations. When you select tools for an agent, they are copied to the agent's llm_config.tools array:
{
  "llm_config": {
    "provider": "openai",
    "model": "gpt-4o-mini",
    "tools": [
      {
        "_template_id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "lookup_customer",
        "description": "Look up customer information",
        "parameters": {
          "type": "object",
          "properties": {
            "phone": {
              "type": "string",
              "description": "Customer phone number"
            }
          },
          "required": ["phone"]
        }
      },
      {
        "_template_id": "660e8400-e29b-41d4-a716-446655440001",
        "type": "endCall"
      }
    ]
  }
}
The _template_id field is used internally to track which template was used. It's ignored by the AI runtime.

Parameter Types#

Function tool parameters support JSON Schema types:
TypeDescriptionExample
stringText values"type": "string"
integerWhole numbers"type": "integer"
numberDecimal numbers"type": "number"
booleantrue/false"type": "boolean"
arrayLists"type": "array", "items": { "type": "string" }
objectNested objects"type": "object", "properties": {...}

Example: Complex Parameters#

{
  "parameters": {
    "type": "object",
    "properties": {
      "customer_id": {
        "type": "string",
        "description": "Customer UUID"
      },
      "order": {
        "type": "object",
        "description": "Order details",
        "properties": {
          "product_id": { "type": "string" },
          "quantity": { "type": "integer", "minimum": 1 }
        },
        "required": ["product_id", "quantity"]
      },
      "tags": {
        "type": "array",
        "description": "Order tags",
        "items": { "type": "string" }
      }
    },
    "required": ["customer_id", "order"]
  }
}

Tool Webhooks#

When the AI decides to use a function tool, a webhook request is sent. See the Tool Calls Webhook documentation for request format and response handling.

Related#

Custom Tools Guide - Detailed guide on building tools
Tool Calls Webhook - Handle tool execution requests
Agents API - Manage agents with tools
Modified at 2025-12-29 14:19:45
Previous
Analysis templates
Next
Overview
Built with