Class McpSkillsJsonContext
- Namespace
- ModelContextProtocol.Extensions.Skills
- Assembly
- ModelContextProtocol.Extensions.Skills.dll
Provides source-generated JSON serialization metadata for the MCP Skills extension types.
[JsonSourceGenerationOptions(DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)]
[JsonSerializable(typeof(Skill))]
[JsonSerializable(typeof(SkillResource))]
[JsonSerializable(typeof(SkillResources))]
[JsonSerializable(typeof(ListSkillsRequestParams))]
[JsonSerializable(typeof(ListSkillsResult))]
[JsonSerializable(typeof(GetSkillRequestParams))]
[JsonSerializable(typeof(GetSkillResult))]
[Experimental("MCPEXP005", UrlFormat = "https://github.com/modelcontextprotocol/csharp-sdk/blob/main/docs/list-of-diagnostics.md#mcpexp005")]
public sealed class McpSkillsJsonContext : JsonSerializerContext, IJsonTypeInfoResolver
- Inheritance
-
McpSkillsJsonContext
- Implements
- Inherited Members
Constructors
McpSkillsJsonContext()
public McpSkillsJsonContext()
McpSkillsJsonContext(JsonSerializerOptions)
Creates an instance of JsonSerializerContext and binds it with the indicated JsonSerializerOptions.
public McpSkillsJsonContext(JsonSerializerOptions options)
Parameters
optionsJsonSerializerOptionsThe run time provided options for the context instance.
Properties
CacheScope
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<CacheScope> CacheScope { get; }
Property Value
Default
The default JsonSerializerContext associated with a default JsonSerializerOptions instance.
public static McpSkillsJsonContext Default { get; }
Property Value
GeneratedSerializerOptions
The source-generated options associated with this context.
protected override JsonSerializerOptions? GeneratedSerializerOptions { get; }
Property Value
GetSkillRequestParams
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<GetSkillRequestParams> GetSkillRequestParams { get; }
Property Value
GetSkillResult
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<GetSkillResult> GetSkillResult { 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
IListSkill
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<IList<Skill>> IListSkill { 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
JsonObject
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<JsonObject> JsonObject { get; }
Property Value
ListSkillsRequestParams
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<ListSkillsRequestParams> ListSkillsRequestParams { get; }
Property Value
ListSkillsResult
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<ListSkillsResult> ListSkillsResult { get; }
Property Value
NullableCacheScope
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<CacheScope?> NullableCacheScope { get; }
Property Value
NullableTimeSpan
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<TimeSpan?> NullableTimeSpan { get; }
Property Value
Skill
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<Skill> Skill { get; }
Property Value
SkillResource
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<SkillResource> SkillResource { get; }
Property Value
SkillResources
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<SkillResources> SkillResources { get; }
Property Value
String
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<string> String { get; }
Property Value
TimeSpan
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<TimeSpan> TimeSpan { 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.