docs: add snippet verification for docs/ pages (#2115)

This commit is contained in:
Felix Weinberger 2026-02-23 15:38:15 +00:00 • committed by GitHub
commit 1ef124e4a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,20 @@
import mcp.types as types
from mcp.server.fastmcp import FastMCP
from mcp.server.fastmcp.prompts import base
from mcp.server.fastmcp.utilities.types import Image
mcp = FastMCP("Image Prompt Example")
@mcp.prompt()
def describe_image(image_path: str) -> list[base.Message]:
"""Prompt that includes an image for analysis."""
img = Image(path=image_path)
return [
base.UserMessage(
content=types.TextContent(type="text", text="Describe this image:"),
),
base.UserMessage(
content=img.to_image_content(),
),
]