Embed code snippets for README from executable examples (#1055)

This commit is contained in:
Inna Harper 2025-07-04 17:25:54 +01:00 • committed by GitHub
commit adf327164a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 1139 additions and 1131 deletions

View file

@ -20,6 +20,6 @@ def desktop() -> list[str]:
@mcp.tool()
def add(a: int, b: int) -> int:
def sum(a: int, b: int) -> int:
"""Add two numbers"""
return a + b

View file

@ -6,7 +6,7 @@ mcp = FastMCP("Demo")
# Add an addition tool
@mcp.tool()
def add(a: int, b: int) -> int:
def sum(a: int, b: int) -> int:
"""Add two numbers"""
return a + b

View file

@ -90,7 +90,7 @@ def get_weather_alerts(region: str) -> list[WeatherAlert]:
WeatherAlert(
severity="high",
title="Heat Wave Warning",
description="Temperatures expected to exceed 40°C",
description="Temperatures expected to exceed 40 degrees",
affected_areas=["Los Angeles", "San Diego", "Riverside"],
valid_until=datetime(2024, 7, 15, 18, 0),
),