Skip to main content
The genai_has_tool_calls function checks whether a GenAI messages array contains any tool calls or function calls. It returns a boolean value indicating if the AI model requested to use external tools or functions during the conversation. You can use this function to filter conversations that use function calling, monitor tool usage patterns, identify integration opportunities, or track feature adoption of function calling capabilities.

For users of other query languages

If you come from other query languages, this section explains how to adjust your existing queries to achieve the same results in APL.
In Splunk SPL, you would check if tool-related fields exist in the messages.
In ANSI SQL, you would check for existence of tool calls in the messages array.

Usage

Syntax

Parameters

Returns

Returns a boolean value: true if the messages contain tool calls, false otherwise.

Example

Check if a GenAI conversation contains any tool calls or function calls. Query
Run in Playground Output This query tracks function calling adoption, helping you understand feature usage trends.