cxxmcp 1.1.6
C++ MCP SDK
Loading...
Searching...
No Matches
mcp::protocol::SamplingMessageContent Struct Reference

One sampling message content item. More...

#include <sampling.hpp>

Public Member Functions

bool is_tool_use () const noexcept
 Returns true when this item carries tool-use content.
 
bool is_tool_result () const noexcept
 Returns true when this item carries tool-result content.
 

Static Public Member Functions

static SamplingMessageContent text (std::string value)
 Creates a text sampling content item.
 
static SamplingMessageContent from_content (ContentBlock value)
 Wraps a regular content block.
 
static SamplingMessageContent tool_use_content (ToolUseContent value)
 Creates an assistant tool-use content item.
 
static SamplingMessageContent tool_result_content (ToolResultContent value)
 Creates a user tool-result content item.
 

Public Attributes

ContentBlock content = ContentBlock::text_content("")
 Ordinary content block for text, image, audio, or extension content.
 
std::optional< ToolUseContenttool_use
 Assistant-only tool-use content.
 
std::optional< ToolResultContenttool_result
 User-only tool-result content.
 

Detailed Description

One sampling message content item.

Text, image, and audio content reuse ContentBlock. SEP-1577 tool-use and tool-result items are modeled explicitly because their wire shape is not the same as ordinary tool-call results.


The documentation for this struct was generated from the following file: