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

Quelle  tutorial001.py   Sprache: Python

 

from mcp.server import MCPServer

mcp = MCPServer("Library")


@mcp.tool()
def search(query: str) -> str:
    """Search the library catalog."""
    return f"3 books match {query!r}."


@mcp.resource("library://hours")
def hours() -> str:
    """When the library is open."""
    return "Mon-Fri 09:00-17:00"

Messung
CHZG
849810094

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

*© Formatika GbR, Deutschland