---
title: ArgumentMatcher
framework: evaluations
role: symbol
role_heading: Enumeration
path: evaluations/argumentmatcher
---

# ArgumentMatcher

The values that define how to validate a tool-call argument.

## Declaration

```swift
enum ArgumentMatcher
```

## Mentioned in

Evaluating tool-calling behavior

## Overview

Overview Use argument matchers to specify validation rules for tool-call arguments. You can require exact values, verify key presence, check ranges, match patterns, or use a language model for semantic matching. For example: let matchers: [ArgumentMatcher] = [     .exact(argumentName: "city", value: "San Francisco"),     .keyOnly(argumentName: "units"),     .naturalLanguage(argumentName: "prompt", criteria: "A weather-related question") ]  |   |   |   |   |   |   |   |   |   |

## Topics

### Exact matching

- [ArgumentMatcher.exact(argumentName:value:)](evaluations/argumentmatcher/exact(argumentname:value:).md)
- [ArgumentMatcher.keyOnly(argumentName:)](evaluations/argumentmatcher/keyonly(argumentname:).md)

### Set and range matching

- [ArgumentMatcher.oneOf(argumentName:allowedValues:)](evaluations/argumentmatcher/oneof(argumentname:allowedvalues:).md)
- [ArgumentMatcher.range(argumentName:minimum:maximum:)](evaluations/argumentmatcher/range(argumentname:minimum:maximum:).md)

### String matching

- [ArgumentMatcher.pattern(argumentName:regex:)](evaluations/argumentmatcher/pattern(argumentname:regex:).md)
- [ArgumentMatcher.contains(argumentName:substring:)](evaluations/argumentmatcher/contains(argumentname:substring:).md)
- [ArgumentMatcher.hasPrefix(argumentName:prefix:)](evaluations/argumentmatcher/hasprefix(argumentname:prefix:).md)
- [ArgumentMatcher.hasSuffix(argumentName:suffix:)](evaluations/argumentmatcher/hassuffix(argumentname:suffix:).md)

### Semantic matching

- [ArgumentMatcher.naturalLanguage(argumentName:criteria:)](evaluations/argumentmatcher/naturallanguage(argumentname:criteria:).md)

### Supporting types

- [ArgumentValue](evaluations/argumentvalue.md)
- [StructuredValue](evaluations/structuredvalue.md)

## Relationships

### Conforms To

- [ConvertibleFromGeneratedContent](foundationmodels/convertiblefromgeneratedcontent.md)
- [ConvertibleToGeneratedContent](foundationmodels/convertibletogeneratedcontent.md)
- [Copyable](swift/copyable.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Escapable](swift/escapable.md)
- [Generable](foundationmodels/generable.md)
- [InstructionsRepresentable](foundationmodels/instructionsrepresentable.md)
- [PromptRepresentable](foundationmodels/promptrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Tool-call evaluation

- [Evaluating tool-calling behavior](evaluations/evaluating-tool-calling-behavior.md)
- [ToolCallEvaluator](evaluations/toolcallevaluator.md)
- [TrajectoryExpectation](evaluations/trajectoryexpectation.md)
