Class McpTasksJsonContext
- Namespace
- ModelContextProtocol.Extensions.Tasks
- Assembly
- ModelContextProtocol.Extensions.Tasks.dll
Provides source-generated JSON serialization metadata for MCP Tasks extension types.
[JsonSourceGenerationOptions(DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)]
[JsonSerializable(typeof(CreateTaskResult))]
[JsonSerializable(typeof(GetTaskRequestParams))]
[JsonSerializable(typeof(GetTaskResult))]
[JsonSerializable(typeof(WorkingTaskResult))]
[JsonSerializable(typeof(CompletedTaskResult))]
[JsonSerializable(typeof(FailedTaskResult))]
[JsonSerializable(typeof(CancelledTaskResult))]
[JsonSerializable(typeof(InputRequiredTaskResult))]
[JsonSerializable(typeof(UpdateTaskRequestParams))]
[JsonSerializable(typeof(UpdateTaskResult))]
[JsonSerializable(typeof(CancelTaskRequestParams))]
[JsonSerializable(typeof(CancelTaskResult))]
[JsonSerializable(typeof(TaskStatusNotificationParams))]
[JsonSerializable(typeof(WorkingTaskNotificationParams))]
[JsonSerializable(typeof(CompletedTaskNotificationParams))]
[JsonSerializable(typeof(FailedTaskNotificationParams))]
[JsonSerializable(typeof(CancelledTaskNotificationParams))]
[JsonSerializable(typeof(InputRequiredTaskNotificationParams))]
public sealed class McpTasksJsonContext : JsonSerializerContext, IJsonTypeInfoResolver
- Inheritance
-
McpTasksJsonContext
- Implements
- Inherited Members
Constructors
McpTasksJsonContext()
public McpTasksJsonContext()
McpTasksJsonContext(JsonSerializerOptions)
Creates an instance of JsonSerializerContext and binds it with the indicated JsonSerializerOptions.
public McpTasksJsonContext(JsonSerializerOptions options)
Parameters
optionsJsonSerializerOptionsThe run time provided options for the context instance.
Properties
CancelTaskRequestParams
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<CancelTaskRequestParams> CancelTaskRequestParams { get; }
Property Value
CancelTaskResult
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<CancelTaskResult> CancelTaskResult { get; }
Property Value
CancelledTaskNotificationParams
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<CancelledTaskNotificationParams> CancelledTaskNotificationParams { get; }
Property Value
CancelledTaskResult
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<CancelledTaskResult> CancelledTaskResult { get; }
Property Value
CompletedTaskNotificationParams
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<CompletedTaskNotificationParams> CompletedTaskNotificationParams { get; }
Property Value
CompletedTaskResult
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<CompletedTaskResult> CompletedTaskResult { get; }
Property Value
CreateTaskResult
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<CreateTaskResult> CreateTaskResult { get; }
Property Value
DateTimeOffset
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<DateTimeOffset> DateTimeOffset { get; }
Property Value
Default
The default JsonSerializerContext associated with a default JsonSerializerOptions instance.
public static McpTasksJsonContext Default { get; }
Property Value
FailedTaskNotificationParams
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<FailedTaskNotificationParams> FailedTaskNotificationParams { get; }
Property Value
FailedTaskResult
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<FailedTaskResult> FailedTaskResult { get; }
Property Value
GeneratedSerializerOptions
The source-generated options associated with this context.
protected override JsonSerializerOptions? GeneratedSerializerOptions { get; }
Property Value
GetTaskRequestParams
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<GetTaskRequestParams> GetTaskRequestParams { get; }
Property Value
GetTaskResult
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<GetTaskResult> GetTaskResult { get; }
Property Value
IDictionaryStringInputRequest
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<IDictionary<string, InputRequest>> IDictionaryStringInputRequest { get; }
Property Value
IDictionaryStringInputResponse
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<IDictionary<string, InputResponse>> IDictionaryStringInputResponse { get; }
Property Value
InputRequest
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<InputRequest> InputRequest { get; }
Property Value
InputRequiredTaskNotificationParams
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<InputRequiredTaskNotificationParams> InputRequiredTaskNotificationParams { get; }
Property Value
InputRequiredTaskResult
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<InputRequiredTaskResult> InputRequiredTaskResult { get; }
Property Value
InputResponse
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<InputResponse> InputResponse { get; }
Property Value
Int64
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<long> Int64 { get; }
Property Value
JsonElement
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<JsonElement> JsonElement { get; }
Property Value
JsonObject
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<JsonObject> JsonObject { get; }
Property Value
McpTaskStatus
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<McpTaskStatus> McpTaskStatus { get; }
Property Value
NullableInt64
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<long?> NullableInt64 { get; }
Property Value
NullableTimeSpan
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<TimeSpan?> NullableTimeSpan { get; }
Property Value
String
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<string> String { get; }
Property Value
TaskStatusNotificationParams
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<TaskStatusNotificationParams> TaskStatusNotificationParams { get; }
Property Value
TimeSpan
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<TimeSpan> TimeSpan { get; }
Property Value
UpdateTaskRequestParams
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<UpdateTaskRequestParams> UpdateTaskRequestParams { get; }
Property Value
UpdateTaskResult
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<UpdateTaskResult> UpdateTaskResult { get; }
Property Value
WorkingTaskNotificationParams
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<WorkingTaskNotificationParams> WorkingTaskNotificationParams { get; }
Property Value
WorkingTaskResult
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<WorkingTaskResult> WorkingTaskResult { get; }
Property Value
Methods
GetTypeInfo(Type)
Gets metadata for the specified type.
public override JsonTypeInfo? GetTypeInfo(Type type)
Parameters
typeTypeThe type to fetch metadata for.
Returns
- JsonTypeInfo
The metadata for the specified type, or null if the context has no metadata for the type.