def METHOD_NAME(index, metadata_type_name, output_format):
    """
    Show information about a metadata type.
    """
    if len(metadata_type_name) == 0:
        mm = list(index.metadata_types.get_all())
    else:
        mm = []
        for name in metadata_type_name:
            m = index.metadata_types.get_by_name(name)
            if m is None:
                echo('No such metadata: {!r}'.format(name), err=True)
                sys.exit(1)
            else:
                mm.append(m)
    if len(mm) == 0:
        echo('No metadata')
        sys.exit(1)
    if output_format == 'yaml':
        yaml.dump_all((m.definition for m in mm),
                      sys.stdout,
                      Dumper=SafeDatacubeDumper,
                      default_flow_style=False,
                      indent=4)
    elif output_format == 'json':
        if len(mm) > 1:
            echo('Can not output more than 1 metadata document in json format', err=True)
            sys.exit(1)
        m = mm[0]
        echo(json.dumps(m.definition, indent=4))