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
parent dfbe56d2b2
commit df2d3a57c2
4 changed files with 57 additions and 6 deletions

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(