Skip to main content

Module content

Module content 

Source
Expand description

Tool result content for a model. Port of toLlmContent in protocol/content.ts of pi-mcp v1.0.0.

Functions§

block_to_llm
One MCP content block as text or an image: embedded text resources become text, image resources images, and audio, links and other binary resources a short placeholder.
to_llm_content
A tool result’s content blocks. Without blocks, its structuredContent as JSON, since servers should but do not always mirror it as text.