Implement MCP task support (SEP-1686) (#1170)
Co-authored-by: Stephen Halter <halter73@gmail.com>
This commit is contained in:
parent
81664c3fce
commit
10e4f5b20f
1 changed files with 11580 additions and 46 deletions
28
src/ModelContextProtocol.Core/Protocol/CreateTaskResult.cs
Normal file
28
src/ModelContextProtocol.Core/Protocol/CreateTaskResult.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace ModelContextProtocol.Protocol;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the response to a task-augmented request.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// When a client sends a request with a <c>task</c> parameter, the server immediately returns
|
||||
/// a <see cref="CreateTaskResult"/> containing the created task information instead of the
|
||||
/// normal result type. The actual result can be retrieved later via <c>tasks/result</c>.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// This type is returned for any task-augmented request including <c>tools/call</c>,
|
||||
/// <c>sampling/createMessage</c>, and <c>elicitation/create</c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
[Experimental(Experimentals.Tasks_DiagnosticId, UrlFormat = Experimentals.Tasks_Url)]
|
||||
public sealed class CreateTaskResult : Result
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the task data for the newly created task.
|
||||
/// </summary>
|
||||
[JsonPropertyName("task")]
|
||||
public McpTask Task { get; set; } = null!;
|
||||
}
|
||||
Loading…
Reference in a new issue