Skip to content

Commit 54e0f12

Browse files
committed
Add IsAccepted to non-generic ElicitResult.
1 parent 1d6c5c7 commit 54e0f12

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/ModelContextProtocol.Core/Protocol/ElicitResult.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ public sealed class ElicitResult : Result
3333
[JsonPropertyName("action")]
3434
public string Action { get; set; } = "cancel";
3535

36+
/// <summary>
37+
/// Convenience indicator for whether the elicitation was accepted by the user.
38+
/// </summary>
39+
/// <remarks>
40+
/// Indicates that the elicitation request completed successfully and value of <see cref="Content"/> has been populated with a value.
41+
/// </remarks>
42+
[JsonIgnore]
43+
public bool IsAccepted => string.Equals(Action, "accept", StringComparison.OrdinalIgnoreCase);
44+
3645
/// <summary>
3746
/// Gets or sets the submitted form data.
3847
/// </summary>

0 commit comments

Comments
 (0)