Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/packages/typesafe/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ uv run --env-file .env --package agent-framework-typesafe \
uv run --env-file .env --package agent-framework-typesafe \
python packages/typesafe/samples/function_calling.py

uv run --with "mcp>=1.27.0,<2" --env-file .env --package agent-framework-typesafe \
uv run --with "mcp>=2.2.0,<3" --env-file .env --package agent-framework-typesafe \
python packages/typesafe/samples/mcp_function_calling.py

uv run --env-file .env --package agent-framework-typesafe \
Expand Down
2 changes: 1 addition & 1 deletion python/packages/typesafe/samples/mcp_function_calling.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# requires-python = ">=3.10"
# dependencies = [
# "agent-framework-typesafe",
# "mcp>=1.27.0,<2",
# "mcp>=2.2.0,<3",
# ]
# ///

Expand Down
8 changes: 4 additions & 4 deletions python/packages/typesafe/samples/mcp_weather_server.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "mcp>=1.27.0,<2",
# "mcp>=2.2.0,<3",
# ]
# ///

Expand All @@ -11,7 +11,7 @@

from typing import Literal

from mcp.server.fastmcp import FastMCP
from mcp.server.mcpserver import MCPServer

"""
Local stdio MCP server used by mcp_function_calling.py.
Expand All @@ -22,10 +22,10 @@
"""

# 1. Define a small deterministic MCP server and one compatible closed-set tool.
server = FastMCP(name="typesafe-weather-sample")
server = MCPServer(name="typesafe-weather-sample")


@server.tool(name="get_weather", description="Get weather for Seattle or Paris.")
@server.tool(name="get_weather", description="Get weather for Seattle or Paris.", structured_output=False)
def get_weather(city: Literal["Seattle", "Paris"], detailed: bool) -> str:
"""Return deterministic sample weather."""
suffix = " with a detailed hourly forecast" if detailed else ""
Expand Down
Loading