# IResponseSchemaSupport

> 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.iresponseschemasupport/
> Summary: IResponseSchemaSupport: An optional interface of an IModelProvider that states which response schema its client sends to the model for a binding.

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

An optional interface of an [IModelProvider](/api/tracon.imodelprovider/) that states which response schema its
client sends to the model for a binding.

```csharp
public interface IResponseSchemaSupport
```

## Remarks

The validation report (`POST /api/agents/validate`) calls it for the binding and for every
[ModelBinding.Fallbacks](/api/tracon.modelbinding/#Tracon_ModelBinding_Fallbacks) link, and warns the author about each difference: a
property that is optional in the author's schema and required on the wire, a bound that
is not sent, and (in strict mode) a part the service refuses. A provider that does not implement this
interface adds nothing to the report.

The answer has to be computed the way the client computes it for a request. A provider that does
not rewrite the schema returns the schema it was given, [ResponseSchemaShape.Strict](/api/tracon.responseschemashape/#Tracon_ResponseSchemaShape_Strict)
from its own setting, and empty lists.

**Lifetime and threading**

The registry holds the provider as a **singleton** and the validation path calls the
method on it, so it may run concurrently. Keep no state between calls: the validation path is not
a hot path, and a cached answer would be a second place that drifts from the client.

**Tenant mode**

The answer is **tenant-independent**: it depends on the binding and the schema, not
on the tenant's own credential.

**Delivery**

A computation over its arguments, with no side effect and no request to the provider: no delivery
guarantee applies.

## Methods

### <a id="Tracon_IResponseSchemaSupport_DescribeResponseSchema_Tracon_ModelBinding_System_Text_Json_JsonElement_"></a> DescribeResponseSchema\(ModelBinding, JsonElement\)

Describes the response schema the provider's client sends for a binding.

```csharp
ResponseSchemaShape DescribeResponseSchema(ModelBinding binding, JsonElement schema)
```

#### Parameters

`binding` [ModelBinding](/api/tracon.modelbinding/)

The binding. A fallback link is described with a binding that carries only its provider and
model, because a link receives none of the primary binding's
[ModelBinding.ProviderSettings](/api/tracon.modelbinding/#Tracon_ModelBinding_ProviderSettings).

`schema` [JsonElement](https://learn.microsoft.com/dotnet/api/system.text.json.jsonelement)

The schema the author wrote. A JSON object.

#### Returns

 [ResponseSchemaShape](/api/tracon.responseschemashape/)

The shape of the schema on the wire.

#### Exceptions

 [TraconException](/api/tracon.traconexception/)

A setting of the binding has a value of the wrong type.

 [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception)

The schema is not a valid schema document.
