Function: hasToolDependencies()
@providerprotocol/agents / index / hasToolDependencies
Function: hasToolDependencies()
Section titled “Function: hasToolDependencies()”hasToolDependencies(
tools):boolean
Defined in: src/execution/tool-ordering.ts:233
Checks if any tools in the array have execution dependencies defined.
This is a quick check to determine if tool ordering is needed. If no tools have dependencies, all calls can execute in parallel without the overhead of dependency resolution.
Parameters
Section titled “Parameters”Tool<unknown, unknown>[]
Tool definitions to check
Returns
Section titled “Returns”boolean
true if any tool has sequential or dependsOn set
Example
Section titled “Example”import { hasToolDependencies } from '@providerprotocol/agents/execution';
if (hasToolDependencies(tools)) { // Need to use orderToolCalls for proper ordering const groups = orderToolCalls(toolCalls, tools);} else { // Can execute all calls in parallel await Promise.all(toolCalls.map(executeTool));}