# TraconA2ABuilderExtensions

> 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.tracona2abuilderextensions/
> Summary: TraconA2ABuilderExtensions: Extensions that register the services needed to publish Tracon agents over A2A.

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

Extensions that register the services needed to publish Tracon agents
over A2A.

```csharp
public static class TraconA2ABuilderExtensions
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.tracona2abuilderextensions/">TraconA2ABuilderExtensions</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Methods

### <a id="Tracon_TraconA2ABuilderExtensions_UseA2A_Tracon_ITraconBuilder_System_Action_Tracon_TraconA2AOptions__"></a> UseA2A\(ITraconBuilder, Action<TraconA2AOptions\>?\)

Registers an A2A server for each agent in
[TraconA2AOptions.ExposedAgents](/api/tracon.tracona2aoptions/#Tracon_TraconA2AOptions_ExposedAgents). The HTTP endpoint must
still be connected separately with `app.MapTraconA2A(...)`.

```csharp
public static ITraconBuilder UseA2A(this ITraconBuilder builder, Action<TraconA2AOptions>? configure = null)
```

#### Parameters

`builder` [ITraconBuilder](/api/tracon.itraconbuilder/)

The Tracon configuration chain.

`configure` [Action](https://learn.microsoft.com/dotnet/api/system.action\-1)<[TraconA2AOptions](/api/tracon.tracona2aoptions/)\>?

Options mutator.

#### Returns

 [ITraconBuilder](/api/tracon.itraconbuilder/)

The chain, for further configuration.

#### Remarks

`ExposedAgents` is read and FROZEN HERE, at registration time.
`AddA2AServer` requires an agent INSTANCE; because Tracon's
catalog can change at runtime (MAF's own registry is not used), a
lazily-resolved [Tracon.ExternalAgentProxy](/api/tracon/) is registered for each
name — the real agent is resolved from the catalog on every call, but
which names exist in A2A is frozen at registration time.

By default no agent is exposed.

A message that carries a `contextId` continues a conversation: the
session is stored, and the agent sees the earlier turns. A conversation
belongs to the caller (the signed-in user, the API key, or, with no
identity at all, the local operator); another caller that sends the same
`contextId` starts a new one. A consumer replaces the storage by
registering an `AgentSessionStore`, keyed by the agent name or
without a key, and the caller identification by registering an
`AgentIsolationKeyProvider`.

```csharp
builder.AddTracon()
       .UseA2A(o => o.ExposedAgents.Add("support"));
```

#### Exceptions

 [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception)

`builder` is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null).
