A consultant is someone who consults but has no power to act on behalf of another.
An agent by definition is someone who does have the power to act on behalf of someone else.
Sometimes the roles overlap. If someone hires me to review and comment on a proposed contract, I would be acting as a consultant. If they also ask me to send proposed changes to the other party, that would make me into an agent since they authorized me to do something on their behalf.
A subcontractor is considered an agent. If you hire me to build a barn and I hire a roofing company to build the roof, the roofers are my agents and subcontractors because they are acting on my behalf in fulfilling part of the contract.
The California Civil Code adopts a simple common law definition of an agent:
2295. An agent is one who represents another, called the principal,
in dealings with third persons. Such representation is called
South Dakota has a similar definition:
59-1-1. Agency defined. Agency is the representation of one called the principal by another called the agent in dealing with third persons.
It is difficult to answer abstract questions, but I hope this information is helpful. If not, please feel free to ask any follow up questions you may have.