MCPcopy Create free account
hub / github.com/IBM/mcp-cli / _text_blocks_from_string

Function _text_blocks_from_string

src/mcp_cli/chat/attachments.py:214–221  ·  view source on GitHub ↗

Build text content blocks from a string.

(text: str, label: str)

Source from the content-addressed store, hash-verified

212
213
214def _text_blocks_from_string(text: str, label: str) -> list[dict[str, Any]]:
215 """Build text content blocks from a string."""
216 return [
217 {
218 "type": "text",
219 "text": f"--- {label} ---\n{text}\n--- end {label} ---",
220 }
221 ]
222
223
224def _build_image_blocks(path: Path, mime: str) -> list[dict[str, Any]]:

Callers 2

_build_text_blocksFunction · 0.85
process_browser_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected