MCP TypeScript SDK (V2)
    Preparing search index...
    • Gets the display name for an object with BaseMetadata. For tools, the precedence is: titleannotations.titlename For other objects: titlename This implements the spec requirement: "if no title is provided, name should be used for display purposes"

      Parameters

      • metadata:
            | { name: string; title?: string }
            | { name: string; title?: string } & { annotations?: { title?: string } }
        • { name: string; title?: string }
          • 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).

        • { name: string; title?: string } & { annotations?: { title?: string } }
          • 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).

          • Optionalannotations?: { title?: string }

      Returns string