o
    *i                     @   sF   d Z ddlmZmZmZmZmZ deeB eB eB eB defddZdS )zUtility 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                 C   sp   t | tr(t| dr| jdur| jS | jr%t| jdr%| jjdur%| jjS | jS t| dr5| jdur5| 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
    titleN)
isinstancer   hasattrr	   annotationsname)r    r   V/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/mcp/shared/metadata_utils.pyget_display_name
   s   
r   N)	__doc__	mcp.typesr   r   r   r   r   strr   r   r   r   r   <module>   s    &