<!--
{
  "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/ToolCallEvaluator",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Evaluations"
    ],
    "preciseIdentifier" : "s:11Evaluations17ToolCallEvaluatorV"
  },
  "title" : "ToolCallEvaluator"
}
-->

# ToolCallEvaluator

An evaluator that verifies agentic tool calls against an expected trajectory.

```
struct ToolCallEvaluator<Input> where Input : ModelSampleProtocol, Input.Expectation == TrajectoryExpectation
```

## Overview

This evaluator produces both a strict and partial result from a single evaluation pass.
It also supports ordered sequences, unordered expectations, disallowed tool checks,
and group steps.

Use the [`toolsAllPass`](/documentation/Evaluations/Metric/toolsAllPass) and [`toolsPercentagePass`](/documentation/Evaluations/Metric/toolsPercentagePass) conveniences
for the standard metrics:

```swift
let evaluator = ToolCallEvaluator<ModelSample<String>>(
    allPass: .toolsAllPass, percentagePass: .toolsPercentagePass
)
```

## Relationships

### Conforms To

[`EvaluatorProtocol`](/documentation/Evaluations/EvaluatorProtocol)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

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)