#include <Pt/Mcp/ContentType.h>
Formats tool results as MCP image content. More...
Inherits ContentType.
Public Member Functions | |
| ContentFormatter * | getFormatter () const override |
| Creates a new ContentFormatter for a result. More... | |
| void | releaseFormatter (ContentFormatter *formatter) const override |
| Releases a ContentFormatter previously obtained from getFormatter(). More... | |
Serializes a decomposed binary result (the tool's return value must decompose to a single Binary node) as a base64-encoded MCP "image" content block. The binary bytes are base64-encoded incrementally as they are decomposed, without buffering the whole image in memory.
|
overridevirtual |
The caller owns the returned ContentFormatter and must release it via releaseFormatter() once done with it, whether the format completed normally or was abandoned. The output stream is not known yet; it is passed to ContentFormatter::beginFormat().
Implements ContentType.
|
overridevirtual |
Deletes formatter; the caller must not use it afterward. Does not write anything - call formatter->finishFormat() first to complete the content block normally.
Implements ContentType.