#include <Pt/Mcp/ContentType.h>
Formats tool results as MCP text 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 the result using TextFormatter (compact YAML-like) and embeds it in a text content block.
|
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.