I am inside an agent entrypoint function. How can ...
# ask-ai
c
I am inside an agent entrypoint function. How can I query the current participants in the room and what information is available from them?
t
Thanks for reaching out, Orion. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You can query the current participants in a room from within an agent entrypoint function using either the job context API or by iterating over the
remote_participants
on the room object. • API Method: Use
ctx.api.room.list_participants()
with the room name to retrieve a full participant list and detailed info. • Room Object: Iterate through
ctx.room.remote_participants.values()
for currently connected remote participants. The information available per participant includes at least: •
identity
name
state
is_publisher
joined_at
metadata
sid
For SIP participants, additional attributes such as
sip.callID
,
sip.callStatus
,
sip.phoneNumber
, and more are available as part of their attributes dictionary. You can also access any custom user attributes and listen for changes to those attributes using event handlers. See the code examples for both API and direct room access methods in the agent context for implementation details and the list of retrievable fields. Reference: Sourced from official documentation and code samples. Sources: Inside a session | LiveKit Docs | mcp/server.py