
    Ch                     x    S r SSKrSSKJr  SSKJrJrJrJrJ	r	J
r
Jr  SSKJr   " S S\\R                  5      rg)z2Base classes and interfaces for FastMCP resources.    N)	Annotated)AnyUrl	BaseModel
ConfigDictFieldUrlConstraintsValidationInfofield_validator)Iconc                   T   \ rS rSr% Sr\" SS9r\" SSS9r\	\
\" SS	94   \S
'   \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   \" SSSS9r\\S'   \" SSS9r\\   S-  \S'   \" SSS9\S\S-  S\S\4S j5       5       r\R4                  S\\-  4S j5       rS rg)!Resource   zBase class for all resources.T)validate_default.zURI of the resource)defaultdescriptionF)host_requiredurizName of the resourceN)r   r   namez$Human-readable title of the resourcetitlezDescription of the resourcer   z
text/plainz!MIME type of the resource contentz^[a-zA-Z0-9]+/[a-zA-Z0-9\-+.]+$)r   r   pattern	mime_typez(Optional list of icons for this resourceiconsbefore)modeinforeturnc                     U(       a  U$ UR                   R                  S5      =n(       a  [        U5      $ [        S5      e)z*Set default name from URI if not provided.r   z#Either name or uri must be provided)datagetstr
ValueError)clsr   r   r   s       [/home/james-whalen/.local/lib/python3.13/site-packages/mcp/server/fastmcp/resources/base.pyset_default_nameResource.set_default_name#   s9     K))--&&3&s8O>??    c                    #    g7f)zRead the resource content.N )selfs    r#   readResource.read-   s
      	s   r(   )__name__
__module____qualname____firstlineno____doc__r   model_configr   r   r   r   r   __annotations__r   r    r   r   r   r   listr   r
   classmethodr	   r$   abcabstractmethodbytesr*   __static_attributes__r(   r&   r#   r   r      s   't4LBGPSavBwC6>>>	?w)?ND#*N*PZ^_E3:_#0MW[\Kt\72Is 
  %T?ijE4:jV(+@C$J @n @ @  ,@ 	C%K  r&   r   )r0   r5   typingr   pydanticr   r   r   r   r   r	   r
   	mcp.typesr   ABCr   r(   r&   r#   <module>r=      s4    8 
    y#'' r&   