Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Python/SDK/docs_src/protocol_versions/     Datei vom 5.10.2026 mit Größe 230 B image not shown  

Quelle  tutorial001.py   Sprache: Python

 

from mcp.server import MCPServer
from mcp.server.mcpserver import Context

mcp = MCPServer("Bookshop")


@mcp.tool()
def search_books(query: str, ctx: Context) -> str:
    """Search the catalog by title or author."""
    return f"[request {ctx.request_id}] Found 3 books matching {query!r}."

Messung
CHZG
839810093

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland