Embed code snippets for README from executable examples (#1055)
This commit is contained in:
parent
7bc190bae8
commit
adf327164a
3 changed files with 1139 additions and 1131 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in a new issue