AgentPrismClientToolExtensions
AgentPrism.Core.dllRegisters 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 AgentPrismClientToolExtensionsInheritance
Section titled “Inheritance”object ← AgentPrismClientToolExtensions
Inherited Members
Section titled “Inherited Members”object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Methods
Section titled “Methods”AddClientTool(IAgentPrismBuilder, string, string, JsonElement)
Section titled “ AddClientTool(IAgentPrismBuilder, string, string, JsonElement)”Registers a tool whose body the server never runs.
public static IAgentPrismBuilder AddClientTool(this IAgentPrismBuilder builder, string name, string description, JsonElement jsonSchema)Parameters
Section titled “Parameters”builder IAgentPrismBuilder
The AgentPrism 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.
Returns
Section titled “Returns”The chain, for further configuration.
Remarks
Section titled “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
(AgentPrism.AspNetCore) to let the turn continue.
A client-side tool cannot require approval — there is no server-side body to defer. ToolRegistry rejects that combination at startup if attempted through a direct AgentPrismToolRegistration registration.
var schema = JsonSerializer.Deserialize<JsonElement>( """{"type":"object","properties":{"path":{"type":"string"}}}""");
builder.AddAgentPrism() .AddClientTool("open_page", "Opens a page in the user's browser.", schema);Exceptions
Section titled “Exceptions”builder is null.
name or description is empty.