Path: redb-route/redb.Route.Llm.Abstractions/Tools/RouteToolBridge.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route.Llm.Abstractions/Tools/RouteToolBridge.cs ---- using redb.Route.Abstractions; using redb.Route.Llm.Abstractions.Tools; namespace redb.Route.Llm.Tools; /// /// Bridges a fixed redb.Route endpoint into the LLM tool surface as an /// . The engine forwards the model's JSON /// input to on a linked child of the agent exchange, /// inheriting its transaction scope, DI scope, properties and route id. /// Headers are propagated by policy rather than inherited — see /// . /// public sealed class RouteToolBridge : ILlmToolDescriptor { /// Permissive default JSON Schema used when no explicit schema is supplied. public const string DefaultInputSchema = """{"type":"object","additionalProperties":true}"""; private readonly string _endpointUri; /// public LlmToolCapability Capability { get; } /// The fixed target endpoint URI this descriptor dispatches to (e.g. direct:order-lookup). public string EndpointUri => _endpointUri; /// Creates a bridge descriptor that forwards calls to . /// Tool capability metadata exposed to the model. /// Target endpoint URI (typically a direct: route). public RouteToolBridge(LlmToolCapability capability, string endpointUri) { ArgumentNullException.ThrowIfNull(capability); ArgumentException.ThrowIfNullOrWhiteSpace(endpointUri); Capability = capability; _endpointUri = endpointUri; } /// Creates a bridge descriptor from a class decorated with . /// Handler type carrying the attribute. /// Target endpoint URI that the handler is mounted on. public static RouteToolBridge FromAttribute(string endpointUri) { var attr = typeof(THandler).GetCustomAttributes(typeof(ExposeAsLlmToolAttribute), inherit: false) .OfType() .FirstOrDefault() ?? throw new InvalidOperationException( $"Type {typeof(THandler).FullName} is not decorated with [ExposeAsLlmTool]."); return new RouteToolBridge(attr.ToCapability(DefaultInputSchema), endpointUri); } /// public string BuildEndpointUri(string inputJson, IExchange parentExchange) => _endpointUri; }