# TraconClientToolExtensions

> 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.traconclienttoolextensions/
> Summary: TraconClientToolExtensions: Registers a client-side tool: its declaration (name, description, JSON schema) lives in code, like every other tool (the code-only tools rule), but its body runs.

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

Registers a client-side tool: its declaration (name, description, JSON
schema) lives in code, like every other tool (the code-only tools rule), but its
body runs on the caller instead of on the server.

```csharp
public static class TraconClientToolExtensions
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.traconclienttoolextensions/">TraconClientToolExtensions</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_TraconClientToolExtensions_AddClientTool_Tracon_ITraconBuilder_System_String_System_String_System_Text_Json_JsonElement_"></a> AddClientTool\(ITraconBuilder, string, string, JsonElement\)

Registers a tool whose body the server never runs.

```csharp
public static ITraconBuilder AddClientTool(this ITraconBuilder builder, string name, string description, JsonElement jsonSchema)
```

#### Parameters

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

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

The tool name. Must be unique among all registered tools.

`description` [string](https://learn.microsoft.com/dotnet/api/system.string)

The description that lets the model understand when to call the tool.

`jsonSchema` [JsonElement](https://learn.microsoft.com/dotnet/api/system.text.json.jsonelement)

The arguments' JSON schema.

#### Returns

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

#### Remarks

The model can call the tool, but the server produces a
`FunctionCallContent` and returns it to the caller instead of
running anything — Microsoft Agent Framework's
`FunctionInvokingChatClient` only invokes an `AIFunction`;
a declaration-only `AIFunctionDeclaration` is not one. The
caller (typically a browser) runs the tool itself and sends the
result back via `AgentRunRequest.ToolResults`
(`Tracon.AspNetCore`) to let the turn continue.

A client-side tool cannot require approval — there is no server-side
body to defer. [Tracon.ToolRegistry](/api/tracon/) rejects that combination at
startup if attempted through a direct
[TraconToolRegistration](/api/tracon.tracontoolregistration/) registration.

```csharp
var schema = JsonSerializer.Deserialize<JsonElement>(
    """{"type":"object","properties":{"path":{"type":"string"}}}""");

builder.AddTracon()
       .AddClientTool("open_page", "Opens a page in the user's browser.", schema);
```

#### Exceptions

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

 [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception)

`name` or `description` is empty.
