fix typo: server has get_context attribute instead of request_context. (#446)

This commit is contained in:
Takayuki SHIMIZUKAWA 2025-05-13 20:12:26 +09:00 • committed by GitHub
commit 173e0ee3b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -619,7 +619,7 @@ server = Server("example-server", lifespan=server_lifespan)
# Access lifespan context in handlers
@server.call_tool()
async def query_db(name: str, arguments: dict) -> list:
ctx = server.request_context
ctx = server.get_context()
db = ctx.lifespan_context["db"]
return await db.query(arguments["query"])
```