# IToolArgumentsValidator

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.itoolargumentsvalidator/
> Summary: IToolArgumentsValidator: Validates a tool call's arguments before the call runs.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

Validates a tool call's arguments before the call runs.

```csharp
public interface IToolArgumentsValidator
```

## Remarks

Binding a call's JSON arguments onto `AI.AIFunctionArguments`
already rejects a type mismatch, a missing `required` field, or an
invalid `enum` value — but it never rejects an extra field the schema
does not declare, and a hand-written `AI.AIFunction` or an
MCP-sourced tool shares none of that behavior. This interface is the
consumer's own gate on top of binding, applied uniformly to every tool
source.

The default implementation is a no-op (registered with
`TryAddSingleton`), so an installation that registers nothing keeps
today's behavior exactly. A consumer replaces the registration to enforce
its own rule; Tracon does not ship a built-in JSON Schema validator —
validation stays inside the consumer's own trust boundary.

If this validator throws, the call is **rejected**
(fail-closed). A gate that fails open on an exception is not a gate.

**Tenant mode:** [IToolArgumentsValidator.ValidateAsync](/api/tracon.itoolargumentsvalidator/#Tracon_IToolArgumentsValidator_ValidateAsync_Tracon_ToolDescriptor_Microsoft_Extensions_AI_AIFunctionArguments_System_Threading_CancellationToken_) carries no
tenant parameter — no delivery guarantee applies to the call it makes
(it runs synchronously, inline, exactly once per tool call attempt; the
validator is never queued or retried by Tracon itself). A
multi-tenant implementation reads the ambient tenant itself, the same
way the tool authorization wrapper reads it for
[IToolAuthorizationHandler](/api/tracon.itoolauthorizationhandler/).

## Methods

### <a id="Tracon_IToolArgumentsValidator_ValidateAsync_Tracon_ToolDescriptor_Microsoft_Extensions_AI_AIFunctionArguments_System_Threading_CancellationToken_"></a> ValidateAsync\(ToolDescriptor, AIFunctionArguments, CancellationToken\)

Validates the arguments of one call before it runs.

```csharp
ValueTask<ToolArgumentsValidationResult> ValidateAsync(ToolDescriptor tool, AIFunctionArguments arguments, CancellationToken cancellationToken = default)
```

#### Parameters

`tool` [ToolDescriptor](/api/tracon.tooldescriptor/)

The tool being called.

`arguments` AIFunctionArguments

The call's bound arguments.

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The cancellation token.

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[ToolArgumentsValidationResult](/api/tracon.toolargumentsvalidationresult/)\>

The validation outcome.
