Table of Contents

Class McpContent

Namespace
LMKit.Mcp.Server
Assembly
LM-Kit.NET.dll

A single content block of an MCP tool result.

[Obfuscation(Exclude = true)]
public sealed class McpContent
Inheritance
McpContent
Inherited Members

Remarks

Use FromResourceLink(string, string, string, string, long?) rather than FromText(string) for payloads that are large or binary. A tool result is inserted verbatim into the caller's context, so inlining a converted document or a rendered page exhausts the context window within a few calls.

Properties

Data

Gets the base64-encoded payload, for image and audio blocks.

Description

Gets the description of the linked resource.

Kind

Gets the kind of this content block.

MimeType

Gets the MIME type of the payload, when known.

Name

Gets the display name of the linked resource.

Size

Gets the size in bytes of the linked resource, when known.

Text

Gets the textual payload, for Text and embedded text resources.

Uri

Gets the resource URI, for resource links and embedded resources.

Methods

FromAudio(string, string)

Creates an audio content block.

FromEmbeddedResource(string, string, string)

Creates a content block carrying resource contents inline.

FromImage(string, string)

Creates an image content block the caller can look at.

FromResourceLink(string, string, string, string, long?)

Creates a pointer to a resource the caller may fetch on demand. This is the correct way to return a produced artifact or any payload above the inline threshold.

FromText(string)

Creates a text content block.

Share