Skip to content

AnswerAttribute

Declares an interactive answer slot on a command handler method. Equivalent to calling WithAnswer(string, string, string?) in the fluent API.

[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public sealed class AnswerAttribute : Attribute

Declares an interactive answer slot on a command handler method. Equivalent to calling WithAnswer(string, string, string?) in the fluent API.

public AnswerAttribute(string name, string type = "string")

Optional description for help text and agent tool schemas.

public string? Description { get; set; }

string

Answer name (matches the name parameter in AskConfirmationAsync, etc.).

public string Name { get; }

string

Value type using route constraint names: string, bool, int, etc.

public string Type { get; }

string