We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
lifespan_context
1 parent c2ca8e0 commit 58b989cCopy full SHA for 58b989c
README.md
@@ -194,7 +194,7 @@ mcp = FastMCP("My App", lifespan=app_lifespan)
194
@mcp.tool()
195
def query_db(ctx: Context) -> str:
196
"""Tool that uses initialized resources"""
197
- db = ctx.request_context.lifespan_context["db"]
+ db = ctx.request_context.lifespan_context.db
198
return db.query()
199
```
200
0 commit comments