Skip to content
Tracon

TraconClientToolExtensions

Namespace Tracon · Assembly Tracon.Core.dll

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.

public static class TraconClientToolExtensions

objectTraconClientToolExtensions

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

AddClientTool(ITraconBuilder, string, string, JsonElement)

Section titled “ AddClientTool(ITraconBuilder, string, string, JsonElement)”

Registers a tool whose body the server never runs.

public static ITraconBuilder AddClientTool(this ITraconBuilder builder, string name, string description, JsonElement jsonSchema)

builder ITraconBuilder

The Tracon configuration chain.

name string

The tool name. Must be unique among all registered tools.

description string

The description that lets the model understand when to call the tool.

jsonSchema JsonElement

The arguments’ JSON schema.

ITraconBuilder

The chain, for further configuration.

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 rejects that combination at startup if attempted through a direct TraconToolRegistration registration.

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);

ArgumentNullException

builder is null.

ArgumentException

name or description is empty.