Table of Contents

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

options JsonSerializerOptions

The 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

JsonTypeInfo<CacheScope>

Default

The default JsonSerializerContext associated with a default JsonSerializerOptions instance.

public static McpSkillsJsonContext Default { get; }

Property Value

McpSkillsJsonContext

GeneratedSerializerOptions

The source-generated options associated with this context.

protected override JsonSerializerOptions? GeneratedSerializerOptions { get; }

Property Value

JsonSerializerOptions

GetSkillRequestParams

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<GetSkillRequestParams> GetSkillRequestParams { get; }

Property Value

JsonTypeInfo<GetSkillRequestParams>

GetSkillResult

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<GetSkillResult> GetSkillResult { get; }

Property Value

JsonTypeInfo<GetSkillResult>

IDictionaryStringInputResponse

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<IDictionary<string, InputResponse>> IDictionaryStringInputResponse { get; }

Property Value

JsonTypeInfo<IDictionary<string, InputResponse>>

IListSkill

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<IList<Skill>> IListSkill { get; }

Property Value

JsonTypeInfo<IList<Skill>>

InputResponse

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<InputResponse> InputResponse { get; }

Property Value

JsonTypeInfo<InputResponse>

Int64

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<long> Int64 { get; }

Property Value

JsonTypeInfo<long>

JsonObject

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<JsonObject> JsonObject { get; }

Property Value

JsonTypeInfo<JsonObject>

ListSkillsRequestParams

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<ListSkillsRequestParams> ListSkillsRequestParams { get; }

Property Value

JsonTypeInfo<ListSkillsRequestParams>

ListSkillsResult

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<ListSkillsResult> ListSkillsResult { get; }

Property Value

JsonTypeInfo<ListSkillsResult>

NullableCacheScope

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<CacheScope?> NullableCacheScope { get; }

Property Value

JsonTypeInfo<CacheScope?>

NullableTimeSpan

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<TimeSpan?> NullableTimeSpan { get; }

Property Value

JsonTypeInfo<TimeSpan?>

Skill

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<Skill> Skill { get; }

Property Value

JsonTypeInfo<Skill>

SkillResource

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<SkillResource> SkillResource { get; }

Property Value

JsonTypeInfo<SkillResource>

SkillResources

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<SkillResources> SkillResources { get; }

Property Value

JsonTypeInfo<SkillResources>

String

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<string> String { get; }

Property Value

JsonTypeInfo<string>

TimeSpan

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<TimeSpan> TimeSpan { get; }

Property Value

JsonTypeInfo<TimeSpan>

Methods

GetTypeInfo(Type)

Gets metadata for the specified type.

public override JsonTypeInfo? GetTypeInfo(Type type)

Parameters

type Type

The type to fetch metadata for.

Returns

JsonTypeInfo

The metadata for the specified type, or null if the context has no metadata for the type.