def METHOD_NAME(
    spec: dict[str, t.Any] | None, pb: type[pb.ServiceMetadataResponse]
) -> pb.ServiceMetadataResponse.DescriptorMetadata:
    from .....io_descriptors.json import parse_dict_to_proto
    if spec is not None:
        descriptor_id = spec.pop("id")
        return pb.DescriptorMetadata(
            descriptor_id=descriptor_id,
            attributes=struct_pb2.Struct(
                fields={
                    key: parse_dict_to_proto(
                        _tuple_converter(value), struct_pb2.Value()
                    )
                    for key, value in spec.items()
                }
            ),
        )
    return pb.DescriptorMetadata()