---
title: "init(ordered:unordered:allowsAdditionalToolCalls:)"
framework: evaluations
role: symbol
role_heading: Initializer
path: "evaluations/trajectoryexpectation/init(ordered:unordered:allowsadditionaltoolcalls:)"
---

# init(ordered:unordered:allowsAdditionalToolCalls:)

Creates a trajectory expectation with ordered and unordered requirements, and controls whether unmatched tool calls are permitted.

## Declaration

```swift
init(ordered: [ToolExpectation] = [], unordered: [ToolExpectation] = [], allowsAdditionalToolCalls: Bool = true)
```

## Parameters

- `ordered`: Steps that must be satisfied in sequential order.
- `unordered`: Tool calls that must occur at some point, regardless of position.
- `allowsAdditionalToolCalls`: A Boolean value indicating whether to allow tool calls that don’t match any expectation; defaults to true

## Mentioned in

Evaluating tool-calling behavior

## Discussion

Discussion Use this initializer when you want to control the blanket policy for unexpected tool calls. To forbid specific tools instead, use init(ordered:unordered:disallowed:).

## See Also

### Creating multi-tool expectations

- [init(ordered:unordered:disallowed:)](evaluations/trajectoryexpectation/init(ordered:unordered:disallowed:).md)
- [init(unordered:)](evaluations/trajectoryexpectation/init(unordered:).md)
