Add resource Link (#974)

This commit is contained in:
Inna Harper 2025-06-17 20:23:07 +01:00 • committed by GitHub
commit d0443a1832
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 66 additions and 22 deletions

View file

@ -41,7 +41,7 @@ def main(
app = Server("mcp-streamable-http-stateless-demo")
@app.call_tool()
async def call_tool(name: str, arguments: dict) -> list[types.Content]:
async def call_tool(name: str, arguments: dict) -> list[types.ContentBlock]:
ctx = app.request_context
interval = arguments.get("interval", 1.0)
count = arguments.get("count", 5)

View file

@ -45,7 +45,7 @@ def main(
app = Server("mcp-streamable-http-demo")
@app.call_tool()
async def call_tool(name: str, arguments: dict) -> list[types.Content]:
async def call_tool(name: str, arguments: dict) -> list[types.ContentBlock]:
ctx = app.request_context
interval = arguments.get("interval", 1.0)
count = arguments.get("count", 5)

View file

@ -7,7 +7,7 @@ from mcp.shared._httpx_utils import create_mcp_http_client
async def fetch_website(
url: str,
) -> list[types.Content]:
) -> list[types.ContentBlock]:
headers = {
"User-Agent": "MCP Test Server (github.com/modelcontextprotocol/python-sdk)"
}
@ -29,7 +29,7 @@ def main(port: int, transport: str) -> int:
app = Server("mcp-website-fetcher")
@app.call_tool()
async def fetch_tool(name: str, arguments: dict) -> list[types.Content]:
async def fetch_tool(name: str, arguments: dict) -> list[types.ContentBlock]:
if name != "fetch":
raise ValueError(f"Unknown tool: {name}")
if "url" not in arguments: