Ë
    ïñþi°  ã                   óL   — d Z ddlmZmZmZmZmZ deez  ez  ez  ez  defd„Zy)zÍUtility functions for working with metadata in MCP types.

These utilities are primarily intended for client-side usage to properly display
human-readable names in user interfaces in a spec compliant way.
é    )ÚImplementationÚPromptÚResourceÚResourceTemplateÚToolÚobjÚreturnc                 ó~  — t        | t        «      r~t        | d«      r| j                  �| j                  S | j                  rBt        | j                  d«      r,| j                  j                  �| j                  j                  S | j
                  S t        | d«      r| j                  �| j                  S | j
                  S )a  
    Get the display name for an MCP object with proper precedence.

    This is a client-side utility function designed to help MCP clients display
    human-readable names in their user interfaces. When servers provide a 'title'
    field, it should be preferred over the programmatic 'name' field for display.

    For tools: title > annotations.title > name
    For other objects: title > name

    Example:
        # In a client displaying available tools
        tools = await session.list_tools()
        for tool in tools.tools:
            display_name = get_display_name(tool)
            print(f"Available tool: {display_name}")

    Args:
        obj: An MCP object with name and optional title fields

    Returns:
        The display name to use for UI presentation
    Útitle)Ú
isinstancer   Úhasattrr   ÚannotationsÚname)r   s    úY/root/aria/mcps/aria-brain/venv/lib/python3.12/site-packages/mcp/shared/metadata_utils.pyÚget_display_namer   
   s�   € ô0 �#”tÔä�3˜Ô  S§Y¡YÐ%:Ø—9‘9ÐØ�?Š?œw s§¡¸Ô@ÀSÇ_Á_×EZÑEZÐEfØ—?‘?×(Ñ(Ð(Ø�x‰xˆô �3˜Ô  S§Y¡YÐ%:Ø—9‘9ÐØ�x‰xˆó    N)	Ú__doc__Ú	mcp.typesr   r   r   r   r   Ústrr   © r   r   ú<module>r      s;   ðñ÷ OÕ Nð#˜$ ™/¨FÑ2Ð5EÑEÈÑVð #Ð[^ô #r   