Resume Help for Contract Consulting Position

Would it be acceptable to list a pas t position as:

01/2018 – 07/2018 XYZ Corp. (contract consulting position)

Or do I need to include the agency like:

01/2018 – 07/2018 XYZ Corp. (contract through ABC Consulting)

I’d rather do the former as I don’t think the consulting company is held in high regard but I also don’t want to break any unwritten rules.

Thoughts?

I think the former is OK. The purpose of a resume is to get you an interview; a prospective employer can ask for details then, if they care.
(FWIW: I’m a proposal manager who sees resumes all the time. I’ve also applied to several jobs over the past 26 years, most recently last summer.)