Fix #355: Fix type error with lifespan context (#368)

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
This commit is contained in:
David Soria Parra 2025-03-26 14:18:41 +00:00 • committed by GitHub
commit df2d3a57c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -652,9 +652,9 @@ class Context(BaseModel, Generic[ServerSessionT, LifespanContextT]):
Returns:
The resource content as either text or bytes
"""
assert self._fastmcp is not None, (
"Context is not available outside of a request"
)
assert (
self._fastmcp is not None
), "Context is not available outside of a request"
return await self._fastmcp.read_resource(uri)
async def log(