Class ContentBlock | MCP C# SDK

Namespace
ModelContextProtocol.Protocol
Assembly
ModelContextProtocol.Core.dll

Represents content within the Model Context Protocol (MCP).

[JsonConverter(typeof(ContentBlock.Converter))]
public abstract class ContentBlock
Inheritance

ContentBlock

Derived
Inherited Members
Extension Methods

Remarks

Properties

Annotations

Gets or sets optional annotations for the content.

[JsonPropertyName("annotations")]
public Annotations? Annotations { get; set; }

Property Value

Annotations

Remarks

Meta

Gets or sets metadata reserved by MCP for protocol-level metadata.

[JsonPropertyName("_meta")]
public JsonObject? Meta { get; set; }

Property Value

JsonObject

Remarks

Type

When overridden in a derived class, gets the type of content.

[JsonPropertyName("type")]
public abstract string Type { get; }

Property Value

string

The type of content. Valid values include "image", "audio", "text", "resource", "resource_link", "tool_use", and "tool_result".

Remarks