.NET API
HostedToolContext
Tracon.Abstractions.dllWhat the factory of a hosted tool (AddHostedTool) learns about the agent it builds the
tool for.
public sealed class HostedToolContext- Inheritance
- object ← HostedToolContext
- Inherited Members
- object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”The factory runs on every run of an agent that selects the tool. Tracon calls it to compare what it builds with the compiled agent in its cache, and compiles the agent again only when the two differ (a new tenant, a new definition, a replaced vector store). Keep it cheap and free of side effects: build the tool from values you already hold, and do not call the network.
A value that belongs to the tenant, for instance the identifier of the tenant’s own vector
store, is read here by HostedToolContext.TenantId. An identifier is not a secret; never put
a credential into a hosted tool.
Constructors
Section titled “Constructors”HostedToolContext()
Section titled “ HostedToolContext()”public HostedToolContext()Properties
Section titled “Properties”Provider
Section titled “ Provider”Gets the name of the model provider of the agent’s primary binding, for example
openai-responses.
public required string Provider { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”A fallback link receives the same tool, so a factory that returns a different tool for each provider serves the primary binding only.
Services
Section titled “ Services”Gets the host’s root service provider.
public required IServiceProvider Services { get; init; }Property Value
Section titled “Property Value”TenantId
Section titled “ TenantId”Gets the tenant the agent is compiled for.
public required string TenantId { get; init; }