Skip to content

Commit 58b989c

Browse files
authored
Fix lifespan_context access example in README (#437)
1 parent c2ca8e0 commit 58b989c

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
@@ -194,7 +194,7 @@ mcp = FastMCP("My App", lifespan=app_lifespan)
194194
@mcp.tool()
195195
def query_db(ctx: Context) -> str:
196196
"""Tool that uses initialized resources"""
197-
db = ctx.request_context.lifespan_context["db"]
197+
db = ctx.request_context.lifespan_context.db
198198
return db.query()
199199
```
200200

0 commit comments

Comments
 (0)