+
    wiS                        R t ^ RIHt ^ RIt^ RIt^ RIHt ^ RIHtH	t	 ^ RI
HtHtHt ^ RIHtHt ^ RIHtHt ^ RIHt ^ R	IHtHt ]'       d   ^ R
IHt ^ RIHt ^ RIHtHt  ! R R]4      t R# )z Resource template functionality.)annotationsN)Callable)TYPE_CHECKINGAny)	BaseModelFieldvalidate_call)FunctionResourceResource)find_context_parameterinject_context)func_metadata)AnnotationsIcon)Context)ServerSessionT)LifespanContextTRequestTc                     ] tR t^t$ Rt]! RR7      tR]R&   ]! RR7      tR]R&   ]! RR	R
7      t	R]R&   ]! RR7      t
R]R&   ]! RRR7      tR]R&   ]! R	RR7      tR]R&   ]! R	RR7      tR]R&   ]! R	RR7      tR]R&   ]! RR7      tR]R&   ]! R R7      tR!]R"&   ]! R	R#R7      tR]R$&   ]R,R% R& ll4       tR' R( ltR-R) R* lltR+tR	# ).ResourceTemplatez.A template for dynamically creating resources.z<URI template with parameters (e.g. weather://{city}/current))descriptionstruri_templatezName of the resourcenamez$Human-readable title of the resourceN)r   default
str | Nonetitlez%Description of what the resource doesr   
text/plainz!MIME type of the resource content)r   r   	mime_typez0Optional list of icons for the resource templatelist[Icon] | Noneiconsz.Optional annotations for the resource templateAnnotations | Noner   z,Optional metadata for this resource templatedict[str, Any] | NonemetaT)excludeCallable[..., Any]fnz#JSON schema for function parametersdict[str, Any]
parametersz-Name of the kwarg that should receive contextcontext_kwargc               D    V ^8  d   QhRRRRRRRRRRR	RR
RRRRRRRRR/# )   r&   r%   r   r   r   r   r   r   r   r    r   r   r!   r#   r"   r)   returnr    )formats   "Z/home/ubuntu/.local/lib/python3.14/site-packages/mcp/server/fastmcp/resources/templates.py__annotate__ResourceTemplate.__annotate__'   sx     ,
 ,
,
 ,
 	,

 ,
  ,
 ,
 !,
 (,
 $,
 ",
 
,
    c                X   T;'       g    VP                   pVR8X  d   \        R4      hV
f   \        V4      p
\        TV
e   V
.M. R7      pVP                  P                  4       p\        V4      pT ! TTTT;'       g    VP                  ;'       g    RT;'       g    RVVV	VVV
R7      # )z"Create a template from a function.z<lambda>z,You must provide a name for lambda functions)
skip_names r   )r   r   r   r   r   r    r   r#   r&   r(   r)   )__name__
ValueErrorr   r   	arg_modelmodel_json_schemar   __doc__)clsr&   r   r   r   r   r   r    r   r#   r)   	func_namefunc_arg_metadatar(   s   &&&&&&&&&&&   r/   from_functionResourceTemplate.from_function&   s     ''BKK	
"KLL  226M **7*C
 '00BBD
 2%#77rzz77R//<#!'
 	
r2   c                    V ^8  d   QhRRRR/# )r+   urir   r,   r"   r-   )r.   s   "r/   r0   r1   U   s      3 #8 r2   c                    V P                   P                  RR4      P                  RR4      p\        P                  ! RV R2V4      pV'       d   VP	                  4       # R# )z5Check if URI matches template and extract parameters.{z(?P<}z>[^/]+)^$N)r   replacerematch	groupdict)selfrA   patternrI   s   &&  r/   matchesResourceTemplate.matchesU   sT     ##++C8@@iP1WIQ-??$$r2   c               (    V ^8  d   QhRRRRRRRR/# )	r+   rA   r   paramsr'   contextz:Context[ServerSessionT, LifespanContextT, RequestT] | Noner,   r
   r-   )r.   s   "r/   r0   r1   ^   s9     L LL L L	L
 
Lr2   c                  a"    \        V P                  W#V P                  4      pV P                  ! R/ VB o\        P                  ! S4      '       d   SG Rj  xL
 o\        VV P                  V P                  V P                  V P                  V P                  V P                  V P                  V3R lR7	      #  Lb  \         d   p\        RT 24      hRp?ii ; i5i)z>Create a resource from the template with the given parameters.Nc                    < S # Nr-   )results   r/   <lambda>2ResourceTemplate.create_resource.<locals>.<lambda>w   s    6r2   )	rA   r   r   r   r   r    r   r#   r&   z'Error creating resource from template: r-   )r   r&   r)   inspectiscoroutiner	   r   r   r   r   r    r   r#   	Exceptionr7   )rK   rA   rP   rQ   erU   s   &&&& @r/   create_resource ResourceTemplate.create_resource^   s     	L#DGGVd>P>PQF WW&v&F""6**%#YYjj ,,..jj ,,YY!
 
 &  	LFqcJKK	Ls<   CAB> B<A!B> ;C<B> >C	CCCr-   )NNNNNNNNrT   )r6   
__module____qualname____firstlineno__r:   r   r   __annotations__r   r   r   r   r    r   r#   r&   r(   r)   classmethodr>   rM   r\   __static_attributes__r-   r2   r/   r   r      s    8*hiL#i"89D#9*PZ^_E:_#0WXKX<=`aIsa$T?qrEr&+DFv&wK#w"'Bp"qD
q"40B0!&3X!YJY %d8g hM:h,
 ,
\L Lr2   r   )!r:   
__future__r   rX   rH   collections.abcr   typingr   r   pydanticr   r   r   "mcp.server.fastmcp.resources.typesr	   r
   .mcp.server.fastmcp.utilities.context_injectionr   r   *mcp.server.fastmcp.utilities.func_metadatar   	mcp.typesr   r   mcp.server.fastmcp.serverr   mcp.server.sessionr   mcp.shared.contextr   r   r   r-   r2   r/   <module>ro      sE    & "  	 $ % 4 4 I a D '11=cLy cLr2   