Enable AI to use tools and execute functions for enhanced capabilities. Includes web search, time utilities, subscriber label management, sequence campaign management, and an extensible tool framework with per-tool AI instructions.

This guide covers the NEXTPION - AI Function Calling DLC, which extends the AI Integration Enhancers plugin to let AI call tools and execute functions — including web search, time queries, subscriber label management, and sequence campaign management — turning your AI from a text-only chatbot into an action-capable assistant.
NEXTPION - AI Function Calling is a DLC expansion for the AI Integration Enhancers plugin. By default, the AI can only generate text replies. This DLC gives your AI the ability to call tools and execute real actions during conversations — such as searching the web for live information, checking the current time, adding labels to subscribers, or managing follow-up sequence campaigns.
The AI decides when and how to use tools based on conversation context. All tool operations happen silently in the background — the subscriber never sees any tool names, function calls, or technical details. They simply experience a smarter, more capable AI assistant.
✅ Tool calling framework — AI autonomously decides when to invoke tools
✅ Web Search — OpenAI built-in real-time web search
✅ Current Time — query date, time, day of week, and timezone
✅ Manage Labels — AI adds or removes subscriber labels based on conversation
✅ Manage Follow-up — AI subscribes or unsubscribes sequence campaigns
✅ Per-tool AI Instruction — customize when and how the AI uses each tool
✅ Whitelist security — AI can only operate on labels and campaigns you explicitly allow
✅ Tool compatibility detection — automatically disables tools incompatible with the selected model
✅ Execution logs — full audit trail of every tool call with parameters, results, and timing
✅ Per-Agent configuration support
This DLC requires the AI Integration Enhancers base plugin to be installed and enabled. If you have not set up the base plugin yet, follow the parent plugin guide first:
After purchasing the DLC from the NEXTPION marketplace, you can install it using the NEXTPION Plugin Manager.
Open your NEXTPION Plugin Manager from the main dashboard. Locate the NEXTPION - AI Function Calling DLC in your purchased DLC list and click the Install button. During installation, you will be asked to enter the license key for this DLC.
After installation is complete, click the Enable button on the DLC card. A modal will open directly on the current page and prompt you to enter the DLC license key. Once the license is verified, you can enable or disable the DLC from this same interface without leaving the page.
Once the DLC is installed and enabled, a new Function Calling settings panel automatically appears in the AI configuration page, below the existing settings.
Navigate to the AI Integration Enhancers configuration page as you normally would (API Channels → OpenAI API).
Scroll down in the left-side settings panel to find the Function Calling section. It displays a toggle switch next to the Function Calling label.
Turn on the toggle. The panel will expand to reveal execution settings and the available tools list.
After enabling Function Calling, you can configure how the AI executes tool calls.
Controls how many rounds of tool calling the AI can perform in a single reply. Each round consists of: AI requests tool call → system executes tool → result returned to AI → AI decides whether to continue.
| Setting | Description |
|---|---|
| Options | 1, 2, 3, 5, 10 |
| Default | 5 |
When enabled, the AI can request multiple tools simultaneously in a single API response. For example, the AI might call "Get Current Time" and "Web Search" at the same time.
| Setting | Description |
|---|---|
| Default | Enabled |
When disabled, the AI can only call one tool at a time.
Only visible when Parallel Calls is enabled. Controls the maximum number of tools the AI can request in a single API response.
| Setting | Description |
|---|---|
| Options | 1, 3, 5, 10, 15, 20 |
| Default | 10 |
Tools are organized by category. Each tool can be individually enabled or disabled. The tool count badge in the top-right corner shows how many tools are currently enabled.
An OpenAI native built-in tool (Responses API) — not a custom function. The AI can search the internet in real time to retrieve live information such as news, pricing, weather, and more.
| Property | Value |
|---|---|
| Type | OpenAI Built-in Tool (web_search) |
| Requires Config | No |
| Search Context Size | medium (default) |
Compatibility limitations:
reasoning_effort is set to minimalWhen a tool is incompatible with the currently selected model, the UI displays an Incompatible badge and automatically disables the tool with a reason message.
A custom function tool that returns the current date, time, day of week, timezone, and UTC offset.
| Property | Value |
|---|---|
| Type | Custom Function |
| Requires Config | No |
| Parameters | timezone (optional) — e.g. Asia/Shanghai, America/New_York, default UTC |
Example response:
{
"date": "2025-07-18",
"time": "14:30:00",
"day_of_week": "Friday",
"timezone": "Asia/Shanghai",
"utc_offset": "+08:00"
}Allows the AI to add or remove labels on the current subscriber based on conversation context. Labels can be used for segmentation, broadcast targeting, and automation flows.
| Property | Value |
|---|---|
| Type | Custom Function |
| Requires Config | Yes — must configure an allowed label whitelist |
| Parameters | action (required: add or remove), label_name (required: must be in whitelist) |
Security: The AI can only operate on labels you have explicitly whitelisted. Attempting to use any label outside the whitelist returns an error. Operations are idempotent — adding an existing label or removing a non-existent label succeeds silently.
Allows the AI to subscribe or unsubscribe the current subscriber to/from follow-up sequence campaigns. For example, subscribing when a user shows interest, and unsubscribing after they complete a purchase.
| Property | Value |
|---|---|
| Type | Custom Function |
| Requires Config | Yes — must configure an allowed campaign whitelist |
| Parameters | action (required: subscribe or unsubscribe), campaign_name (required: must be in whitelist) |
Security: Same whitelist and idempotency guarantees as Manage Labels.
Tools that require configuration (Manage Labels and Manage Follow-up) display a Needs Config badge when enabled. Click the gear icon ⚙️ on the tool row to open the configuration modal.
Click the gear icon ⚙️ next to the Manage Labels tool to open the label configuration modal.
The modal first shows all Facebook and Instagram pages that have Bot enabled. Select the page you want to configure labels for.
After selecting a page, the system loads all labels for that page, showing the label name and subscriber count. Check the labels you want the AI to be able to operate on.
Click Apply to save. The selected labels appear as tag chips below the tool in the settings panel.
Labels must already exist in ChatPion's Subscriber Manager. This modal only selects which existing labels the AI is allowed to use — it does not create new labels.
Click the gear icon ⚙️ next to the Manage Follow-up tool to open the sequence configuration modal.
Select a Facebook or Instagram page from the list.
The system loads all Messenger sequence campaigns for the selected page and platform. Check the campaigns you want the AI to be able to operate on.
Click Apply to save. The selected campaigns appear as chips below the tool in the settings panel.
Each enabled tool can have its own AI Instruction that tells the AI when and how to use that specific tool. Click the chat bubble icon 💬 on the tool row to open the AI Instruction editor.
The AI Instruction editor uses a two-column layout:
Left Panel — Tool Reference:
Enum values (e.g. add, remove) and configured label/campaign names can be clicked to insert into the instruction editor. Inserted values are automatically highlighted:
Right Panel — Instruction Editor: A textarea with real-time syntax highlighting for writing tool-specific AI instructions.
Manage Labels:
When a user confirms they have purchased a product, add the "Purchased" label.
When a user asks about premium features or mentions budget over $100, add the "VIP Potential" label.
If a user explicitly asks to stop receiving promotions, add the "No Promo" label.
Do not add labels based on casual browsing — only when clear intent is shown.Manage Follow-up:
Subscribe the user to "Product Interest Follow-up" when they ask about pricing or features but haven't made a purchase decision yet.
Unsubscribe from "Product Interest Follow-up" when the user confirms a purchase.
Do not subscribe users who are just asking general questions — only when genuine product interest is detected.When Function Calling is enabled, the system automatically injects the current subscriber's context into the AI's system prompt, including:
This allows the AI to make smarter decisions — for example, checking whether a label already exists before adding it, or verifying a subscriber is not already in a sequence before subscribing them.
The system automatically injects tool usage rules into the AI's system prompt. These rules ensure consistent, invisible, and intelligent tool behavior:
| Tool | When It Triggers |
|---|---|
| Manage Labels | User behavior or confirmed status indicates a label change is appropriate |
| Manage Follow-up | User shows interest but hasn't completed an action (subscribe) or completes an action (unsubscribe) |
| Current Time | Only when answering genuinely requires current time and no reliable time info exists in context |
| Web Search | When real-time information is needed to answer the user's question |
If MCP Server tools are also enabled, the system instructs the AI to:
The system automatically checks each tool's compatibility with the currently selected AI model.
| Model | Web Search | Custom Functions |
|---|---|---|
| gpt-5 | ✅ (not with reasoning_effort: minimal) | ✅ |
| gpt-5-mini | ✅ (not with reasoning_effort: minimal) | ✅ |
| gpt-5.4-nano | ✅ | ✅ |
| gpt-5-nano | ⚠️ Not recommended | ⚠️ Not recommended |
| gpt-4.1-nano | ❌ No Web Search | ✅ |
gpt-5-nano is not suitable for Function Calling. This model tends to enter infinite loops when calling tools — repeatedly invoking the same tool, wasting tokens without completing the conversation. Use gpt-5.4-nano (which fixes this issue), gpt-5-mini, or gpt-5 instead.
reasoning_effort also triggers a compatibility re-checkAfter configuring Function Calling, you can immediately test the results in the AI Playground panel on the right side of the configuration page.
When using Stream Mode, the AI Playground displays the complete tool calling process in real time:
Each AI message that includes tool calls displays a clickable summary line below the message:
🔧 Used 2 tools (7ms) >Click this summary to open the detailed tool call panel showing:
This gives you full visibility into the AI's tool usage decisions, making it easy to debug and optimize your AI Instructions.
Use Stream Mode in AI Playground as your primary debugging tool: configure tools and AI Instructions → send test messages → observe tool reasoning and execution in real time → adjust instructions → repeat until the AI behaves as expected.
During real conversations (not AI Playground), when the AI triggers tool calls while chatting with a subscriber, the system automatically inserts system messages into Live Chat to record the result of each tool call.
Each tool call system message follows this format:
✅ Manage Labels: Label "Lead" added successfully
❌ Manage Follow-up: Campaign "Sales Follow-up" not found in allowed list
✅ Current Time: {"date":"2025-07-18","time":"14:30:00","day_of_week":"Friday",...}sender: system, agent_name: tool_call)Live Chat tool call records let you:
These system messages are only visible to backend administrators. Subscribers never see any tool call information in their Messenger conversation.
Function Calling supports both global and per-agent settings:
This means different agents can:
When creating a new agent, Function Calling configuration resets to defaults (disabled state) and must be configured separately for each agent.
If you use the AI Agents DLC, each agent's configuration page includes its own Function Calling settings panel. Changes to one agent's settings do not affect other agents or the global configuration.
The AI can only operate on labels and campaigns you have explicitly configured in the whitelist:
All tool operations are idempotent — repeating the same operation produces no side effects:
user_idStart with simple tools first Enable Current Time and Web Search first to verify the basic tool calling flow works, then add Manage Labels and Manage Follow-up.
Write specific AI Instructions Generic instructions like "use this tool when appropriate" are too vague. Write clear trigger conditions with concrete examples, such as "add the 'Purchased' label when the user confirms they have completed a purchase."
Use the click-to-insert feature When writing AI Instructions, click on parameter enum values and configured label/campaign names in the left reference panel to insert them into the instruction editor. This ensures exact name matching and adds visual highlighting.
Choose the right model Use gpt-5.4-nano for the best balance of cost and reliability. Avoid gpt-5-nano for Function Calling due to loop issues. Use gpt-5-mini or gpt-5 for complex multi-tool scenarios.
Keep whitelists focused Only whitelist the labels and campaigns that the AI genuinely needs to operate on. A smaller, focused whitelist leads to more accurate AI decisions.
Test in Stream Mode Always use Stream Mode in AI Playground when testing Function Calling. This lets you see the AI's reasoning process, tool call parameters, and execution results in real time — essential for debugging.
Monitor execution logs Regularly review tool execution logs to identify patterns — such as frequent errors, unnecessary calls, or unexpected tool usage — and adjust your AI Instructions accordingly.
Use per-agent configuration for different pages If different pages serve different purposes (e.g. support vs. sales), create separate agents with tailored tool configurations — different whitelists, different AI Instructions, even different enabled tools.
AI Function Calling is most powerful when combined with clear AI Instructions and the right model choice. The AI will silently manage labels, sequence campaigns, and information retrieval in the background — making your Messenger bot feel intelligent and responsive without any manual intervention.