@@ -118,9 +118,9 @@ class Settings(BaseSettings, Generic[LifespanResultT]):
118118 description = "List of dependencies to install in the server environment" ,
119119 )
120120
121- lifespan : Callable [[ FastMCP ], AbstractAsyncContextManager [ LifespanResultT ]] | None = Field (
122- None , description = "Lifespan context manager"
123- )
121+ lifespan : (
122+ Callable [[ FastMCP ], AbstractAsyncContextManager [ LifespanResultT ]] | None
123+ ) = Field ( None , description = "Lifespan context manager" )
124124
125125 auth : AuthSettings | None = None
126126
@@ -424,7 +424,8 @@ async def async_tool(x: int, context: Context) -> str:
424424 # Check if user passed function directly instead of calling decorator
425425 if callable (name ):
426426 raise TypeError (
427- "The @tool decorator was used incorrectly. Did you forget to call it? Use @tool() instead of @tool"
427+ "The @tool decorator was used incorrectly. "
428+ "Did you forget to call it? Use @tool() instead of @tool"
428429 )
429430
430431 def decorator (fn : AnyFunction ) -> AnyFunction :
@@ -506,7 +507,8 @@ def decorator(fn: AnyFunction) -> AnyFunction:
506507
507508 if uri_params != func_params :
508509 raise ValueError (
509- f"Mismatch between URI parameters { uri_params } and function parameters { func_params } "
510+ f"Mismatch between URI parameters { uri_params } "
511+ f"and function parameters { func_params } "
510512 )
511513
512514 # Register as template
@@ -539,7 +541,9 @@ def add_prompt(self, prompt: Prompt) -> None:
539541 """
540542 self ._prompt_manager .add_prompt (prompt )
541543
542- def prompt (self , name : str | None = None , description : str | None = None ) -> Callable [[AnyFunction ], AnyFunction ]:
544+ def prompt (
545+ self , name : str | None = None , description : str | None = None
546+ ) -> Callable [[AnyFunction ], AnyFunction ]:
543547 """Decorator to register a prompt.
544548
545549 Args:
@@ -902,7 +906,9 @@ async def list_prompts(self) -> list[MCPPrompt]:
902906 for prompt in prompts
903907 ]
904908
905- async def get_prompt (self , name : str , arguments : dict [str , Any ] | None = None ) -> GetPromptResult :
909+ async def get_prompt (
910+ self , name : str , arguments : dict [str , Any ] | None = None
911+ ) -> GetPromptResult :
906912 """Get a prompt by name with arguments."""
907913 try :
908914 messages = await self ._prompt_manager .render_prompt (name , arguments )
@@ -1032,7 +1038,9 @@ async def read_resource(self, uri: str | AnyUrl) -> Iterable[ReadResourceContent
10321038 Returns:
10331039 The resource content as either text or bytes
10341040 """
1035- assert self ._fastmcp is not None , "Context is not available outside of a request"
1041+ assert (
1042+ self ._fastmcp is not None
1043+ ), "Context is not available outside of a request"
10361044 return await self ._fastmcp .read_resource (uri )
10371045
10381046 async def log (
@@ -1060,7 +1068,11 @@ async def log(
10601068 @property
10611069 def client_id (self ) -> str | None :
10621070 """Get the client ID if available."""
1063- return getattr (self .request_context .meta , "client_id" , None ) if self .request_context .meta else None
1071+ return (
1072+ getattr (self .request_context .meta , "client_id" , None )
1073+ if self .request_context .meta
1074+ else None
1075+ )
10641076
10651077 @property
10661078 def request_id (self ) -> str :
0 commit comments