Make UrlElicitationRequiredErrorData.Elicitations consistent with other Protocol DTOs (#1335)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
This commit is contained in:
Copilot 2026-02-20 23:12:16 -05:00 • committed by GitHub
commit 4648d3e8e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -12,5 +12,5 @@ public sealed class UrlElicitationRequiredErrorData
/// Gets or sets the elicitations that must be completed before retrying the original request.
/// </summary>
[JsonPropertyName("elicitations")]
public required IReadOnlyList<ElicitRequestParams> Elicitations { get; init; }
public required IList<ElicitRequestParams> Elicitations { get; set; }
}

View file

@ -12,7 +12,7 @@ namespace ModelContextProtocol;
/// </summary>
public sealed class UrlElicitationRequiredException : McpProtocolException
{
private readonly IReadOnlyList<ElicitRequestParams> _elicitations;
private readonly List<ElicitRequestParams> _elicitations;
/// <summary>
/// Initializes a new instance of the <see cref="UrlElicitationRequiredException"/> class with the specified message and pending elicitations.
@ -66,7 +66,7 @@ public sealed class UrlElicitationRequiredException : McpProtocolException
return true;
}
private static bool TryParseElicitations(JsonElement dataElement, out IReadOnlyList<ElicitRequestParams> elicitations)
private static bool TryParseElicitations(JsonElement dataElement, out IList<ElicitRequestParams> elicitations)
{
elicitations = [];
@ -93,7 +93,7 @@ public sealed class UrlElicitationRequiredException : McpProtocolException
return true;
}
private static IReadOnlyList<ElicitRequestParams> Validate(IEnumerable<ElicitRequestParams> elicitations)
private static List<ElicitRequestParams> Validate(IEnumerable<ElicitRequestParams> elicitations)
{
var list = new List<ElicitRequestParams>();
foreach (var elicitation in elicitations)