docs: restructure into topical sections and add the four most-asked-for pages (#3044)
This commit is contained in:
parent
080f2a869d
commit
220d362112
1 changed files with 2403 additions and 343 deletions
15
docs_src/troubleshooting/tutorial002.py
Normal file
15
docs_src/troubleshooting/tutorial002.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
from mcp.server import MCPServer
|
||||
|
||||
mcp = MCPServer("Weather")
|
||||
|
||||
|
||||
@mcp.tool(name="forecast")
|
||||
def forecast_today(city: str) -> str:
|
||||
"""Today's forecast for one city."""
|
||||
return f"{city}: Rain."
|
||||
|
||||
|
||||
@mcp.tool(name="forecast") # Same name. This registration is dropped.
|
||||
def forecast_hourly(city: str, hours: int) -> str:
|
||||
"""The next few hours for one city."""
|
||||
return f"{city}: Rain for {hours}h."
|
||||
Loading…
Reference in a new issue