11 [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.ReturnValue |
12 AttributeTargets.Property | AttributeTargets.Field,
13 Inherited =
true, AllowMultiple =
false)]
38 throw new ArgumentException(
"MinValue is not a float-point type.", nameof(
MinValue));
41 throw new ArgumentException(
"MaxValue is not a float-point type.", nameof(
MaxValue));
44 private static bool IsFloatingPointType(
object? Value)
49 switch (Type.GetTypeCode(Value.GetType()))
53 case TypeCode.Decimal:
65 public override void Annotate(Dictionary<string, object?> Schema)
67 base.Annotate(Schema);
69 Schema[
"type"] =
"number";
78 base.GetHtmlInputAttributes(Attributes);
79 Attributes[
"type"] =
"number";
80 Attributes[
"step"] =
"any";
Provides meta-data about a floating-point-valued parameter.
override void Annotate(Dictionary< string, object?> Schema)
Annotates a schema object with information in the attribute.
override string GetHtmlAttributeValue(object Value)
Gets the HTML attribute value for a parameter, if any.
McpFloatingPointParameterAttribute(string? Title, string? Description, object? MinValue, object? MaxValue)
Provides meta-data about a floating-point-valued parameter.
McpFloatingPointParameterAttribute(string? Title, string? Description)
Provides meta-data about a floating-point-valued parameter.
override void GetHtmlInputAttributes(Dictionary< string, string > Attributes)
Gets HTML input attributes for the parameter, if any.
string? Title
Title of parameter.
string? Description
Description of parameter.
Abstract base class for MCP-parameters that have a range of valid values.
object? MinValue
Minimum value of the range.
object? MaxValue
Maximum value of the range.
Class managing a script expression.
static string ToExpressionString(object Value)
Converts an object to a string, that can be parsed as part of an expression.