GetAgent

The GetAgent action retrieves information about the current Agent. The current Agent is the one you are currently working in the context of. For example, if you use GetAgent in any Skill of My Receptionist Agent, you will get this specific agent information.

GetAgent(
  field: str,
  idn: str
)

Where:

  • field: Literal["id", "title", "description", "name", "personaId"]
  • idn: (Optional) The identifier of a specific agent to query. If omitted, returns information about the current agent.

Example 1 (No Field)

A basic example with no GetAgent field strings returning the agent's name. In this case, the agent is named Mike.

{{set(name="agent_", value=GetAgent())}}

{{SendMessage(message=agent_)}}
Mike

Example 2 (Specific Field)

This example of the GetAgent action specifies a specific field to return. In this case, the agent's title is Hotel Receptionist. Only one field can be specified at a time.

{{set(name="agent_", value=GetAgent(field="title"))}}

{{SendMessage(message=agent_)}}
Hotel Receptionist

Example 3 (Cross-Agent Query)

This example uses the idn parameter to retrieve the persona ID of a different agent (ConvoAgent) from within another agent's skill.

{{set(name="convo_agent_persona", value=GetAgent(idn="ConvoAgent", field="personaId"))}}

{{SendMessage(message=convo_agent_persona)}}