@modelcontextprotocol/sdk
    Preparing search index...

    Function getDisplayName

    • Gets the display name for an object with BaseMetadata. For tools, the precedence is: title → annotations.title → name For other objects: title → name This implements the spec requirement: "if no title is provided, name should be used for display purposes"

      Parameters

      • metadata: { name: string; title?: string; [key: string]: unknown }
        • [key: string]: unknown
        • name: string

          Intended for programmatic or logical use, but used as a display name in past specs or fallback

        • Optionaltitle?: string

          Intended for UI and end-user contexts — optimized to be human-readable and easily understood, even by those unfamiliar with domain-specific terminology.

          If not provided, the name should be used for display (except for Tool, where annotations.title should be given precedence over using name, if present).

      Returns string