Skip to content

Commit 8beee78

Browse files
Fix in README.md to use right request_context syntax as per discussion in the issue. TESTED = all current tests pass
1 parent f2f4dbd commit 8beee78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ server = Server("example-server", lifespan=server_lifespan)
631631
# Access lifespan context in handlers
632632
@server.call_tool()
633633
async def query_db(name: str, arguments: dict) -> list:
634-
ctx = server.get_context()
634+
ctx = server.request_context
635635
db = ctx.lifespan_context["db"]
636636
return await db.query(arguments["query"])
637637
```

0 commit comments

Comments
 (0)