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

Function process_url

src/mcp_cli/chat/attachments.py:319–332  ·  view source on GitHub ↗

Build an image_url content block from a URL (no download).

(url: str)

Source from the content-addressed store, hash-verified

317
318
319def process_url(url: str) -> Attachment:
320 """Build an image_url content block from a URL (no download)."""
321 return Attachment(
322 source=url,
323 content_blocks=[
324 {
325 "type": "image_url",
326 "image_url": {"url": url, "detail": DEFAULT_IMAGE_DETAIL_LEVEL},
327 }
328 ],
329 display_name=url.rsplit("/", 1)[-1][:60],
330 size_bytes=0,
331 mime_type="image/unknown",
332 )
333
334
335# ------------------------------------------------------------------ #

Callers 3

test_basic_urlMethod · 0.90
test_display_nameMethod · 0.90
test_url_imageMethod · 0.90

Calls 1

AttachmentClass · 0.85

Tested by 3

test_basic_urlMethod · 0.72
test_display_nameMethod · 0.72
test_url_imageMethod · 0.72