<!--
{
  "availability" : [
    "Xcode: 27.0.0 -",
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Evaluations",
  "identifier" : "/documentation/Evaluations/TrajectoryExpectation/init(ordered:unordered:allowsAdditionalToolCalls:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Evaluations"
    ],
    "preciseIdentifier" : "s:11Evaluations21TrajectoryExpectationV7ordered9unordered25allowsAdditionalToolCallsACSayAA0hC0VG_AISbtcfc"
  },
  "title" : "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.

```
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`

## 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:)`](/documentation/Evaluations/TrajectoryExpectation/init(ordered:unordered:disallowed:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)