Class ExposeAsLlmToolAttribute

Assembly: redb.Route.Llm.Abstractions.dll

Marks a class, method, or route definition as exposable to an LLM as a tool.
Discovered by the engine's tool registrars; the attribute carries the same
metadata as so a descriptor can be built
without reflecting on the handler body.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method|AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public sealed class ExposeAsLlmToolAttribute : Attribute

Inheritance

Object→Attribute→ExposeAsLlmToolAttribute

Properties

Caching

Caching policy hint.

public ToolCachingPolicy Caching { get; init; }

Cost

Cost class hint for budget-aware scheduling.

public ToolCostClass Cost { get; init; }

Description

Human-readable tool description shown to the model. Required.

public string Description { get; }

InputSchema

JSON Schema string for input parameters. Optional — when omitted the engine assigns a permissive object schema.

public string? InputSchema { get; init; }

Name

Stable tool name used by the model. Required.

public string Name { get; }

RequiredClaims

Comma-separated list of claims required on the calling principal. Empty = no requirements.

public string RequiredClaims { get; init; }

RequiresApproval

When true the tool always requires explicit user approval before execution.

public bool RequiresApproval { get; init; }

SideEffect

Side-effect classification. Drives approval and idempotency policies.

public ToolSideEffect SideEffect { get; init; }

Methods

ToCapability(string)

Builds an from this attribute, applying

public LlmToolCapability ToCapability(string defaultInputSchema)

Constructors

ExposeAsLlmToolAttribute(string, string)

Creates a tool exposure attribute.