chore: create union for working with message content (#939)

This commit is contained in:
Luca Chang
2025-06-12 00:01:33 -07:00
committed by GitHub
parent 185fa49fd1
commit d69b290b65
9 changed files with 25 additions and 51 deletions

View File

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